mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use rb_init_identtable instead of direct use of rb_hashtype_ident
This commit is contained in:
parent
e052d07163
commit
313d63c2ac
1 changed files with 2 additions and 3 deletions
5
gc.c
5
gc.c
|
@ -11152,7 +11152,6 @@ static const rb_data_type_t weakmap_type = {
|
||||||
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
0, 0, RUBY_TYPED_FREE_IMMEDIATELY
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const struct st_hash_type rb_hashtype_ident;
|
|
||||||
static VALUE wmap_finalize(RB_BLOCK_CALL_FUNC_ARGLIST(objid, self));
|
static VALUE wmap_finalize(RB_BLOCK_CALL_FUNC_ARGLIST(objid, self));
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -11160,8 +11159,8 @@ wmap_allocate(VALUE klass)
|
||||||
{
|
{
|
||||||
struct weakmap *w;
|
struct weakmap *w;
|
||||||
VALUE obj = TypedData_Make_Struct(klass, struct weakmap, &weakmap_type, w);
|
VALUE obj = TypedData_Make_Struct(klass, struct weakmap, &weakmap_type, w);
|
||||||
w->obj2wmap = st_init_table(&rb_hashtype_ident);
|
w->obj2wmap = rb_init_identtable();
|
||||||
w->wmap2obj = st_init_table(&rb_hashtype_ident);
|
w->wmap2obj = rb_init_identtable();
|
||||||
w->final = rb_func_lambda_new(wmap_finalize, obj, 1, 1);
|
w->final = rb_func_lambda_new(wmap_finalize, obj, 1, 1);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue