diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-25 13:19:45 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-25 13:19:45 +0000 |
commit | fdb771d82db5c258757d3e2f18102eca680ecfd5 (patch) | |
tree | d844d16e6f337254d83927ec61e063cf5307007d /gc.c | |
parent | 872b9ec89665e5d4fb557ae6ed50eab1a3303fbc (diff) |
Make imemo_alloc writebarrier-unprotected
imemo_alloc provides a memory buffer whose contents are marked by GC.
C code can access imemo_alloc buffer freely, so imemo_alloc must be
considered writebarrier-unprotected. But T_IMEMO is writebarrier-
protected by default, which caused a GC bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -8118,6 +8118,7 @@ rb_alloc_tmp_buffer_with_count(volatile VALUE *store, size_t size, size_t cnt) void *ptr; s = rb_imemo_new(imemo_alloc, 0, 0, 0, 0); + rb_gc_writebarrier_unprotect(s); ptr = ruby_xmalloc0(size); a = (rb_imemo_alloc_t*)s; a->ptr = (VALUE*)ptr; |