mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 22:51:50 +03:00
Fix junk filling for mremap(2)-based huge reallocation.
If mremap(2) is used for huge reallocation, physical pages are mapped to new virtual addresses rather than data being copied to new pages. This bypasses the normal junk filling that would happen during allocation, so add junk filling that is specific to this case.
This commit is contained in:
parent
cb657e3170
commit
940fdfd5ee
2 changed files with 16 additions and 3 deletions
|
|
@ -92,9 +92,12 @@ test_junk(size_t sz_min, size_t sz_max)
|
|||
s = (char *)rallocx(s, sz+1, 0);
|
||||
assert_ptr_not_null((void *)s,
|
||||
"Unexpected rallocx() failure");
|
||||
assert_ptr_eq(most_recently_junked, junked,
|
||||
"Expected region of size %zu to be junk-filled",
|
||||
sz);
|
||||
if (!config_mremap || sz+1 <= arena_maxclass) {
|
||||
assert_ptr_eq(most_recently_junked, junked,
|
||||
"Expected region of size %zu to be "
|
||||
"junk-filled",
|
||||
sz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue