mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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.
This commit is contained in:
parent
6201a89b38
commit
b11b26bcaf
1 changed files with 1 additions and 1 deletions
|
@ -408,7 +408,7 @@ rb_transient_heap_alloc(VALUE obj, size_t req_size)
|
||||||
RB_DEBUG_COUNTER_INC(theap_alloc);
|
RB_DEBUG_COUNTER_INC(theap_alloc);
|
||||||
|
|
||||||
/* ptr is set up; OK to unpoison. */
|
/* ptr is set up; OK to unpoison. */
|
||||||
unpoison_memory_region(ptr, size, true);
|
unpoison_memory_region(ptr, size - sizeof *header, true);
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue