summaryrefslogtreecommitdiff
path: root/imemo.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-09-15 10:50:01 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-09-15 11:43:05 -0400
commit7dd9c76ad46af63f76e0df243f76a1720f54d50d (patch)
treeb1d443854459939efedb55575d003d81c3eec3de /imemo.c
parent1e3e04cd657c35fdd8d95096195d6b72b64e516c (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/imemo.c b/imemo.c
index 1fc49c434a..7cec33bc1e 100644
--- a/imemo.c
+++ b/imemo.c
@@ -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 *