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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user