diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-01-26 14:34:25 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-01-26 14:34:25 +0900 |
commit | 16e7585557c338563447861ee50f835514bb7e3c (patch) | |
tree | a33e406001fe0e6236a37d0822e4263dafbd9b52 /gc.c | |
parent | c925d3b6689515f76dcfbb1dc419746dac6f0738 (diff) |
Unpoison the cached object in the exact size
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2372,11 +2372,17 @@ ractor_cached_free_region(rb_objspace_t *objspace, rb_ractor_t *cr, size_t size_ if (p) { VALUE obj = (VALUE)p; + MAYBE_UNUSED(const size_t) stride = size_pool_slot_size(size_pool_idx); cache->freelist = p->as.free.next; +#if USE_RVARGC + asan_unpoison_memory_region(p, stride, true); +#else asan_unpoison_object(obj, true); +#endif #if RGENGC_CHECK_MODE + GC_ASSERT(cache->using_page.slot_size == (short)stride); // zero clear - MEMZERO((char *)obj, char, size_pool_slot_size(size_pool_idx)); + MEMZERO((char *)obj, char, stride); #endif return obj; } |