diff options
author | Jason Evans <je@fb.com> | 2016-02-23 00:20:56 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2016-02-23 00:47:34 (GMT) |
commit | 0da8ce1e96bedff697f7133c8cfb328390b6d11d (patch) | |
tree | ef03b16e4f8f14c726b5597573cd2e4cd568bbfa /test/unit | |
parent | 08551eee586eefa8c98f33b97679f259af50afab (diff) | |
download | jemalloc-0da8ce1e96bedff697f7133c8cfb328390b6d11d.zip jemalloc-0da8ce1e96bedff697f7133c8cfb328390b6d11d.tar.gz jemalloc-0da8ce1e96bedff697f7133c8cfb328390b6d11d.tar.bz2 |
Use table lookup for run_quantize_{floor,ceil}().
Reduce run quantization overhead by generating lookup tables during
bootstrapping, and using the tables for all subsequent run quantization.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/run_quantize.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/test/unit/run_quantize.c b/test/unit/run_quantize.c index aff4056..f6a2f74 100644 --- a/test/unit/run_quantize.c +++ b/test/unit/run_quantize.c @@ -93,19 +93,14 @@ TEST_END TEST_BEGIN(test_monotonic) { - bool cache_oblivious; unsigned nbins, nlruns, i; - size_t sz, max_run_size, floor_prev, ceil_prev; + size_t sz, floor_prev, ceil_prev; /* * Iterate over all run sizes and verify that * run_quantize_{floor,ceil}() are monotonic. */ - sz = sizeof(bool); - assert_d_eq(mallctl("config.cache_oblivious", &cache_oblivious, &sz, - NULL, 0), 0, "Unexpected mallctl failure"); - sz = sizeof(unsigned); assert_d_eq(mallctl("arenas.nbins", &nbins, &sz, NULL, 0), 0, "Unexpected mallctl failure"); @@ -114,12 +109,9 @@ TEST_BEGIN(test_monotonic) assert_d_eq(mallctl("arenas.nlruns", &nlruns, &sz, NULL, 0), 0, "Unexpected mallctl failure"); - max_run_size = (large_maxclass > small_maxrun) ? large_maxclass : - small_maxrun; - floor_prev = 0; ceil_prev = 0; - for (i = 1; i < max_run_size >> LG_PAGE; i++) { + for (i = 1; i < run_quantize_max >> LG_PAGE; i++) { size_t run_size, floor, ceil; run_size = i << LG_PAGE; |