Pass alloc_ctx down profiling path.
With this change, when profiling is enabled, we avoid doing redundant rtree lookups. Also changed dalloc_atx_t to alloc_atx_t, as it's now used on allocation path as well (to speed up profiling).
This commit is contained in:
@@ -15,7 +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");
|
||||
tctx_p = prof_tctx_get(tsdn, p);
|
||||
tctx_p = prof_tctx_get(tsdn, p, NULL);
|
||||
assert_ptr_ne(tctx_p, (prof_tctx_t *)(uintptr_t)1U,
|
||||
"Expected valid tctx");
|
||||
prof_cnt_all(&curobjs_1, NULL, NULL, NULL);
|
||||
@@ -25,7 +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");
|
||||
tctx_q = prof_tctx_get(tsdn, q);
|
||||
tctx_q = prof_tctx_get(tsdn, q, NULL);
|
||||
assert_ptr_ne(tctx_q, (prof_tctx_t *)(uintptr_t)1U,
|
||||
"Expected valid tctx");
|
||||
prof_cnt_all(&curobjs_2, NULL, NULL, NULL);
|
||||
|
Reference in New Issue
Block a user