зеркало из https://github.com/github/ruby.git
gc.c: use boolean
* gc.c (obj_free): use free_immediately as boolean. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
bcfb4569aa
Коммит
b9ed44e7c7
6
gc.c
6
gc.c
|
@ -1355,13 +1355,13 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
|
|||
break;
|
||||
case T_DATA:
|
||||
if (DATA_PTR(obj)) {
|
||||
int free_immediately = 0;
|
||||
int free_immediately = FALSE;
|
||||
|
||||
if (RTYPEDDATA_P(obj)) {
|
||||
free_immediately = (int)(RANY(obj)->as.typeddata.type->flags & RUBY_TYPED_FREE_IMMEDIATELY);
|
||||
free_immediately = (RANY(obj)->as.typeddata.type->flags & RUBY_TYPED_FREE_IMMEDIATELY) != 0;
|
||||
RDATA(obj)->dfree = RANY(obj)->as.typeddata.type->function.dfree;
|
||||
if (0 && free_immediately == 0) /* to expose non-free-immediate T_DATA */
|
||||
fprintf(stderr, "not immediate -> %s\n", RANY(obj)->as.typeddata.type->wrap_struct_name);
|
||||
fprintf(stderr, "not immediate -> %s\n", RANY(obj)->as.typeddata.type->wrap_struct_name);
|
||||
}
|
||||
if (RANY(obj)->as.data.dfree == RUBY_DEFAULT_FREE) {
|
||||
xfree(DATA_PTR(obj));
|
||||
|
|
Загрузка…
Ссылка в новой задаче