Skip to content

Commit ad82b72

Browse files
committed
Skip imemo_tmpbuf sweeping when the buffer was eagerly freed.
`imemo_tmpbuf` can be skipped if `ptr` is `NULL` which is often the case if `RB_ALLOCV_END` was used.
1 parent 1fb0aca commit ad82b72

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/imemo.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,10 @@ rb_imemo_needs_cleanup_p(VALUE obj)
310310
case imemo_iseq:
311311
case imemo_callinfo:
312312
case imemo_fields:
313-
case imemo_tmpbuf:
314313
return true;
314+
315+
case imemo_tmpbuf:
316+
return ((rb_imemo_tmpbuf_t *)obj)->ptr != NULL;
315317
}
316318
UNREACHABLE_RETURN(true);
317319
}

0 commit comments

Comments
 (0)