* gc.c: rename is_dying_object() to is_garbage_object().

* gc.h: rb_objspace_garbage_object_p() as an exported function.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2014-07-06 15:42:14 +00:00
parent 6a9b242a80
commit 2006bfe2f4
3 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,9 @@
Mon Jul 7 00:36:13 2014 Koichi Sasada <ko1@atdot.net>
* gc.c: rename is_dying_object() to is_garbage_object().
* gc.h: rb_objspace_garbage_object_p() as an exported function.
Sun Jul 6 21:30:35 2014 Koichi Sasada <ko1@atdot.net> Sun Jul 6 21:30:35 2014 Koichi Sasada <ko1@atdot.net>
* gc.c (is_dying_object): fix missed condition. * gc.c (is_dying_object): fix missed condition.

9
gc.c
View File

@ -2329,8 +2329,9 @@ is_swept_object(rb_objspace_t *objspace, VALUE ptr)
} }
} }
/* garbage objects will be collected soon. */
static inline int static inline int
is_dying_object(rb_objspace_t *objspace, VALUE ptr) is_garbage_object(rb_objspace_t *objspace, VALUE ptr)
{ {
if (!is_lazy_sweeping(heap_eden) || if (!is_lazy_sweeping(heap_eden) ||
is_swept_object(objspace, ptr) || is_swept_object(objspace, ptr) ||
@ -2352,7 +2353,7 @@ is_live_object(rb_objspace_t *objspace, VALUE ptr)
return FALSE; return FALSE;
} }
if (!is_dying_object(objspace, ptr)) { if (!is_garbage_object(objspace, ptr)) {
return TRUE; return TRUE;
} }
else { else {
@ -2382,10 +2383,10 @@ rb_objspace_markable_object_p(VALUE obj)
} }
int int
rb_objspace_dying_object_p(VALUE obj) rb_objspace_garbage_object_p(VALUE obj)
{ {
rb_objspace_t *objspace = &rb_objspace; rb_objspace_t *objspace = &rb_objspace;
return is_dying_object(objspace, obj); return is_garbage_object(objspace, obj);
} }
/* /*

1
gc.h
View File

@ -92,6 +92,7 @@ void rb_objspace_reachable_objects_from_root(void (func)(const char *category, V
int rb_objspace_markable_object_p(VALUE obj); int rb_objspace_markable_object_p(VALUE obj);
int rb_objspace_internal_object_p(VALUE obj); int rb_objspace_internal_object_p(VALUE obj);
int rb_objspace_marked_object_p(VALUE obj); int rb_objspace_marked_object_p(VALUE obj);
int rb_objspace_garbage_object_p(VALUE obj);
void rb_objspace_each_objects( void rb_objspace_each_objects(
int (*callback)(void *start, void *end, size_t stride, void *data), int (*callback)(void *start, void *end, size_t stride, void *data),