mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
gc.c (obj_free): use simpler is_dead()
`mrb_object_dead_p()` is heavier if the pointer is (or used to be) an object in the heaps.
This commit is contained in:
@@ -798,7 +798,7 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
|
||||
|
||||
while (ce <= ci) {
|
||||
struct REnv *e = ci->u.env;
|
||||
if (e && !mrb_object_dead_p(mrb, (struct RBasic*)e) &&
|
||||
if (e && !is_dead(&mrb->gc, (struct RBasic*)e) &&
|
||||
e->tt == MRB_TT_ENV && MRB_ENV_ONSTACK_P(e)) {
|
||||
mrb_env_unshare(mrb, e, TRUE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user