diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2025-09-15 10:50:01 -0400 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-09-15 11:43:05 -0400 |
| commit | 7dd9c76ad46af63f76e0df243f76a1720f54d50d (patch) | |
| tree | b1d443854459939efedb55575d003d81c3eec3de /imemo.c | |
| parent | 1e3e04cd657c35fdd8d95096195d6b72b64e516c (diff) | |
Make imemo_tmpbuf not write-barrier protected
imemo_tmpbuf is not write-barrier protected and uses mark maybe to mark
the buffer it holds. The normal rb_imemo_new creates a write-barrier
protected object which can make the tmpbuf miss marking references.
Diffstat (limited to 'imemo.c')
| -rw-r--r-- | imemo.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -51,7 +51,10 @@ rb_imemo_new(enum imemo_type type, VALUE v0, size_t size) VALUE rb_imemo_tmpbuf_new(void) { - return rb_imemo_new(imemo_tmpbuf, 0, sizeof(rb_imemo_tmpbuf_t)); + VALUE flags = T_IMEMO | (imemo_tmpbuf << FL_USHIFT); + NEWOBJ_OF(obj, rb_imemo_tmpbuf_t, 0, flags, sizeof(rb_imemo_tmpbuf_t), NULL); + + return (VALUE)obj; } void * |
