diff options
author | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2019-04-24 12:24:44 +0900 |
---|---|---|
committer | Urabe, Shyouhei <shyouhei@ruby-lang.org> | 2019-04-26 15:59:40 +0900 |
commit | b11b26bcaf711ad01d1a81943cca42f7ff40bfee (patch) | |
tree | 4ccd063fd9457f17699bb3467996c293c9ee1c1a /transient_heap.c | |
parent | 6201a89b38afb6bb2a548aeba0ca77090851713b (diff) | |
download | ruby-b11b26bcaf711ad01d1a81943cca42f7ff40bfee.tar.gz |
fix size of allocated memory
The size of `ptr` here is not the same as the variable `size`.
We were counting the size of header twice.
Diffstat (limited to 'transient_heap.c')
-rw-r--r-- | transient_heap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/transient_heap.c b/transient_heap.c index eb94edabf7..1bc5094a09 100644 --- a/transient_heap.c +++ b/transient_heap.c @@ -408,7 +408,7 @@ rb_transient_heap_alloc(VALUE obj, size_t req_size) RB_DEBUG_COUNTER_INC(theap_alloc); /* ptr is set up; OK to unpoison. */ - unpoison_memory_region(ptr, size, true); + unpoison_memory_region(ptr, size - sizeof *header, true); return ptr; } else { |