mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Hide size class computation behind a layer of indirection.
This class removes almost all the dependencies on size_classes.h, accessing the data there only via the new module sc.h, which does not depend on any configuration options. In a subsequent commit, we'll remove the configure-time size class computations, doing them at boot time, instead.
This commit is contained in:
committed by
David Goldblatt
parent
fb924dd7bf
commit
e904f813b4
@@ -33,7 +33,7 @@ TEST_BEGIN(test_stats_large) {
|
||||
size_t sz;
|
||||
int expected = config_stats ? 0 : ENOENT;
|
||||
|
||||
p = mallocx(SMALL_MAXCLASS+1, MALLOCX_ARENA(0));
|
||||
p = mallocx(sc_data_global.small_maxclass + 1, MALLOCX_ARENA(0));
|
||||
assert_ptr_not_null(p, "Unexpected mallocx() failure");
|
||||
|
||||
assert_d_eq(mallctl("epoch", NULL, NULL, (void *)&epoch, sizeof(epoch)),
|
||||
@@ -74,9 +74,10 @@ TEST_BEGIN(test_stats_arenas_summary) {
|
||||
uint64_t dirty_npurge, dirty_nmadvise, dirty_purged;
|
||||
uint64_t muzzy_npurge, muzzy_nmadvise, muzzy_purged;
|
||||
|
||||
little = mallocx(SMALL_MAXCLASS, MALLOCX_ARENA(0));
|
||||
little = mallocx(sc_data_global.small_maxclass, MALLOCX_ARENA(0));
|
||||
assert_ptr_not_null(little, "Unexpected mallocx() failure");
|
||||
large = mallocx((1U << LG_LARGE_MINCLASS), MALLOCX_ARENA(0));
|
||||
large = mallocx((1U << sc_data_global.lg_large_minclass),
|
||||
MALLOCX_ARENA(0));
|
||||
assert_ptr_not_null(large, "Unexpected mallocx() failure");
|
||||
|
||||
dallocx(little, 0);
|
||||
@@ -148,7 +149,7 @@ TEST_BEGIN(test_stats_arenas_small) {
|
||||
|
||||
no_lazy_lock(); /* Lazy locking would dodge tcache testing. */
|
||||
|
||||
p = mallocx(SMALL_MAXCLASS, MALLOCX_ARENA(0));
|
||||
p = mallocx(sc_data_global.small_maxclass, MALLOCX_ARENA(0));
|
||||
assert_ptr_not_null(p, "Unexpected mallocx() failure");
|
||||
|
||||
assert_d_eq(mallctl("thread.tcache.flush", NULL, NULL, NULL, 0),
|
||||
@@ -191,7 +192,7 @@ TEST_BEGIN(test_stats_arenas_large) {
|
||||
uint64_t epoch, nmalloc, ndalloc;
|
||||
int expected = config_stats ? 0 : ENOENT;
|
||||
|
||||
p = mallocx((1U << LG_LARGE_MINCLASS), MALLOCX_ARENA(0));
|
||||
p = mallocx((1U << sc_data_global.lg_large_minclass), MALLOCX_ARENA(0));
|
||||
assert_ptr_not_null(p, "Unexpected mallocx() failure");
|
||||
|
||||
assert_d_eq(mallctl("epoch", NULL, NULL, (void *)&epoch, sizeof(epoch)),
|
||||
|
||||
Reference in New Issue
Block a user