diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-04 14:32:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-04 14:32:48 +0000 |
commit | 9533da6f1f306491858ba12fc630171e6ad97ae7 (patch) | |
tree | 737f75f31d3ffee6071cfa699b34b2a9dca18f3d | |
parent | af9b0da125871c6bfbc3b7893d199a79420e5833 (diff) | |
download | ruby-9533da6f1f306491858ba12fc630171e6ad97ae7.tar.gz |
gc.c: UNEXPECTED_NODE
* gc.c (UNEXPECTED_NODE): extract rb_bug for T_NODE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | gc.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -2000,6 +2000,10 @@ rb_newobj_of(VALUE klass, VALUE flags) return newobj_of(klass, flags & ~FL_WB_PROTECTED, 0, 0, 0, flags & FL_WB_PROTECTED); } +#define UNEXPECTED_NODE(func) \ + rb_bug(#func"(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, \ + BUILTIN_TYPE(obj), (void*)(obj), RBASIC(obj)->flags) + #undef rb_imemo_new VALUE @@ -2320,8 +2324,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj) break; case T_NODE: - rb_bug("obj_free(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(obj_free); break; case T_STRUCT: @@ -2526,9 +2529,8 @@ internal_object_p(VALUE obj) if (p->as.basic.flags) { switch (BUILTIN_TYPE(p)) { case T_NODE: - rb_bug("internal_object_p(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); - break; + UNEXPECTED_NODE(internal_object_p); + break; case T_NONE: case T_IMEMO: case T_ICLASS: @@ -3302,8 +3304,7 @@ obj_memsize_of(VALUE obj, int use_all_types) break; case T_NODE: - rb_bug("obj_memsize_of(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(obj_memsize_of); break; case T_STRUCT: @@ -4568,8 +4569,7 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj) break; case T_NODE: - rb_bug("rb_gc_mark(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(rb_gc_mark); break; case T_IMEMO: @@ -9327,8 +9327,7 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) switch (type) { case T_NODE: - rb_bug("rb_raw_obj_info(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(rb_raw_obj_info); break; case T_ARRAY: snprintf(buff, buff_size, "%s [%s%s] len: %d", buff, |