diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-04-08 12:08:45 +0200 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2026-04-08 12:59:59 +0200 |
| commit | ad82b7274a3efd2ad76e2c73a7474f9a74539e32 (patch) | |
| tree | cd67188fc5bdc06bafddb20a4a613daf864fb026 | |
| parent | 1fb0aca3bac9544c01143a768f638fcfad7cff9c (diff) | |
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.
| -rw-r--r-- | internal/imemo.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/imemo.h b/internal/imemo.h index 2ccb42c85e..4f2c4ebfbf 100644 --- a/internal/imemo.h +++ b/internal/imemo.h @@ -310,8 +310,10 @@ rb_imemo_needs_cleanup_p(VALUE obj) case imemo_iseq: case imemo_callinfo: case imemo_fields: - case imemo_tmpbuf: return true; + + case imemo_tmpbuf: + return ((rb_imemo_tmpbuf_t *)obj)->ptr != NULL; } UNREACHABLE_RETURN(true); } |
