ruby-changes:72488
From: Nobuyoshi <ko1@a...>
Date: Sun, 10 Jul 2022 16:38:41 +0900 (JST)
Subject: [ruby-changes:72488] b16f44ad4f (master): Get rid of static buffer in `obj_info`
https://git.ruby-lang.org/ruby.git/commit/?id=b16f44ad4f From b16f44ad4f61e7827878d9f164d1a53414e80ea4 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 6 Jul 2022 00:57:59 +0900 Subject: Get rid of static buffer in `obj_info` --- gc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gc.c b/gc.c index 2b3538814f..2ed5cc831c 100644 --- a/gc.c +++ b/gc.c @@ -13748,8 +13748,8 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L13748 break; case T_ARRAY: if (FL_TEST(obj, ELTS_SHARED)) { - APPENDF((BUFF_ARGS, "shared -> %s", - rb_obj_info(RARRAY(obj)->as.heap.aux.shared_root))); + APPENDF((BUFF_ARGS, "shared -> ")); + rb_raw_obj_info(BUFF_ARGS, RARRAY(obj)->as.heap.aux.shared_root); } else if (FL_TEST(obj, RARRAY_EMBED_FLAG)) { APPENDF((BUFF_ARGS, "[%s%s] len: %ld (embed)", @@ -13880,7 +13880,9 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L13880 if (me->def) { switch (me->def->type) { case VM_METHOD_TYPE_ISEQ: - APPENDF((BUFF_ARGS, " (iseq:%s)", obj_info((VALUE)me->def->body.iseq.iseqptr))); + APPENDF((BUFF_ARGS, " (iseq:")); + rb_raw_obj_info(BUFF_ARGS, (VALUE)me->def->body.iseq.iseqptr); + APPENDF((BUFF_ARGS, ")")); break; default: break; -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/