mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-03 17:10:32 +03:00
Add alloc hook test in test/integration/extent.
This commit is contained in:
parent
d955d6f2be
commit
bdcf40a620
1 changed files with 3 additions and 0 deletions
|
|
@ -39,10 +39,13 @@ test_extent_body(unsigned arena_ind) {
|
||||||
assert_d_eq(mallctlnametomib("arena.0.purge", purge_mib, &purge_miblen),
|
assert_d_eq(mallctlnametomib("arena.0.purge", purge_mib, &purge_miblen),
|
||||||
0, "Unexpected mallctlnametomib() failure");
|
0, "Unexpected mallctlnametomib() failure");
|
||||||
purge_mib[1] = (size_t)arena_ind;
|
purge_mib[1] = (size_t)arena_ind;
|
||||||
|
called_alloc = false;
|
||||||
|
try_alloc = true;
|
||||||
try_dalloc = false;
|
try_dalloc = false;
|
||||||
try_decommit = false;
|
try_decommit = false;
|
||||||
p = mallocx(large0 * 2, flags);
|
p = mallocx(large0 * 2, flags);
|
||||||
assert_ptr_not_null(p, "Unexpected mallocx() error");
|
assert_ptr_not_null(p, "Unexpected mallocx() error");
|
||||||
|
assert_true(called_alloc, "Expected alloc call");
|
||||||
called_dalloc = false;
|
called_dalloc = false;
|
||||||
called_decommit = false;
|
called_decommit = false;
|
||||||
did_purge_lazy = false;
|
did_purge_lazy = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue