mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-17 02:16:24 +03:00
Push down iealloc() calls.
Call iealloc() as deep into call chains as possible without causing redundant calls.
This commit is contained in:
parent
51a2ec92a1
commit
5e67fbc367
9 changed files with 176 additions and 227 deletions
|
|
@ -4,7 +4,6 @@ TEST_BEGIN(test_prof_realloc) {
|
|||
tsdn_t *tsdn;
|
||||
int flags;
|
||||
void *p, *q;
|
||||
extent_t *extent_p, *extent_q;
|
||||
prof_tctx_t *tctx_p, *tctx_q;
|
||||
uint64_t curobjs_0, curobjs_1, curobjs_2, curobjs_3;
|
||||
|
||||
|
|
@ -16,9 +15,7 @@ TEST_BEGIN(test_prof_realloc) {
|
|||
prof_cnt_all(&curobjs_0, NULL, NULL, NULL);
|
||||
p = mallocx(1024, flags);
|
||||
assert_ptr_not_null(p, "Unexpected mallocx() failure");
|
||||
extent_p = iealloc(tsdn, p);
|
||||
assert_ptr_not_null(extent_p, "Unexpected iealloc() failure");
|
||||
tctx_p = prof_tctx_get(tsdn, extent_p, p);
|
||||
tctx_p = prof_tctx_get(tsdn, p);
|
||||
assert_ptr_ne(tctx_p, (prof_tctx_t *)(uintptr_t)1U,
|
||||
"Expected valid tctx");
|
||||
prof_cnt_all(&curobjs_1, NULL, NULL, NULL);
|
||||
|
|
@ -28,9 +25,7 @@ TEST_BEGIN(test_prof_realloc) {
|
|||
q = rallocx(p, 2048, flags);
|
||||
assert_ptr_ne(p, q, "Expected move");
|
||||
assert_ptr_not_null(p, "Unexpected rmallocx() failure");
|
||||
extent_q = iealloc(tsdn, q);
|
||||
assert_ptr_not_null(extent_q, "Unexpected iealloc() failure");
|
||||
tctx_q = prof_tctx_get(tsdn, extent_q, q);
|
||||
tctx_q = prof_tctx_get(tsdn, q);
|
||||
assert_ptr_ne(tctx_q, (prof_tctx_t *)(uintptr_t)1U,
|
||||
"Expected valid tctx");
|
||||
prof_cnt_all(&curobjs_2, NULL, NULL, NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue