* 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:
nobu 2013-11-03 12:40:29 +00:00
Родитель bcfb4569aa
Коммит b9ed44e7c7
1 изменённых файлов: 3 добавлений и 3 удалений

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));