diff options
| author | Satoshi Tagomori <s-tagomori@sakura.ad.jp> | 2025-12-30 22:01:54 +0900 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2026-01-05 13:00:14 -0800 |
| commit | 9b2ff68f17d225aed2ae9e72a51014cbfcaaaff1 (patch) | |
| tree | 3fb04f3dc5bc7ae99325a2a12bf6dd047d80a6e0 | |
| parent | b3371c6ae5dd6fcecd12128f7b3e1e18e219bd3d (diff) | |
Box: skip checking the current box is the root box
Because checking the current box is not a cheap process.
| -rw-r--r-- | class.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -820,7 +820,7 @@ class_alloc0(enum ruby_value_type type, VALUE klass, bool boxable) static VALUE class_alloc(enum ruby_value_type type, VALUE klass) { - bool boxable = BOX_ROOT_P(rb_current_box()); + bool boxable = rb_box_available() && BOX_ROOT_P(rb_current_box()); return class_alloc0(type, klass, boxable); } |
