зеркало из https://github.com/github/ruby.git
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:
Родитель
6201a89b38
Коммит
b11b26bcaf
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче