Replace internal memory calls with non-standard jemalloc API
The jemalloc non-standard API fits nicely with our memory contexts, so just rewrite the memory context internals to use the non-public API. There's just one caveat - since we no longer track the size of the allocation for isc_mem_allocate/isc_mem_free combination, we need to use sallocx() to get real allocation size in both allocator and deallocator because otherwise the sizes would not match.
This commit is contained in:
@@ -181,8 +181,7 @@ isc_mem_total_test(void **state) {
|
||||
after = isc_mem_total(mctx2);
|
||||
diff = after - before;
|
||||
|
||||
/* 2048 +8 bytes extra for size_info */
|
||||
assert_int_equal(diff, (2048 + 8) * 100000);
|
||||
assert_int_equal(diff, (2048) * 100000);
|
||||
|
||||
/* ISC_MEMFLAG_INTERNAL */
|
||||
|
||||
@@ -198,8 +197,7 @@ isc_mem_total_test(void **state) {
|
||||
after = isc_mem_total(test_mctx);
|
||||
diff = after - before;
|
||||
|
||||
/* 2048 +8 bytes extra for size_info */
|
||||
assert_int_equal(diff, (2048 + 8) * 100000);
|
||||
assert_int_equal(diff, (2048) * 100000);
|
||||
|
||||
isc_mem_destroy(&mctx2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user