diff options
author | Jason Evans <jasone@canonware.com> | 2016-02-28 07:40:31 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2016-02-28 07:40:31 (GMT) |
commit | 7d3055432d303f114d15f67c60bdebcbb4dbd39a (patch) | |
tree | 863f74615182f4677ec63100a6c74823b57949b7 /test/unit | |
parent | 39f58755a7c2c5c12c9b732c17fe472c9872ab4b (diff) | |
download | jemalloc-7d3055432d303f114d15f67c60bdebcbb4dbd39a.zip jemalloc-7d3055432d303f114d15f67c60bdebcbb4dbd39a.tar.gz jemalloc-7d3055432d303f114d15f67c60bdebcbb4dbd39a.tar.bz2 |
Fix decay tests for --disable-tcache case.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/decay.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/test/unit/decay.c b/test/unit/decay.c index 1052f6f..70a2e67 100644 --- a/test/unit/decay.c +++ b/test/unit/decay.c @@ -160,7 +160,7 @@ TEST_BEGIN(test_decay_ticks) * Test tcache fill/flush interactions for large and small size classes, * using an explicit tcache. */ - { + if (config_tcache) { unsigned tcache_ind, i; size_t tcache_sizes[2]; tcache_sizes[0] = large0; @@ -204,7 +204,7 @@ TEST_BEGIN(test_decay_ticker) uint64_t epoch; uint64_t npurge0 = 0; uint64_t npurge1 = 0; - size_t sz, tcache_max, large; + size_t sz, large; unsigned i, nupdates0; nstime_t time, decay_time, deadline; @@ -216,10 +216,18 @@ TEST_BEGIN(test_decay_ticker) * verify the ticker triggers purging. */ - sz = sizeof(size_t); - assert_d_eq(mallctl("arenas.tcache_max", &tcache_max, &sz, NULL, 0), 0, - "Unexpected mallctl failure"); - large = nallocx(tcache_max + 1, flags); + if (config_tcache) { + size_t tcache_max; + + sz = sizeof(size_t); + assert_d_eq(mallctl("arenas.tcache_max", &tcache_max, &sz, NULL, + 0), 0, "Unexpected mallctl failure"); + large = nallocx(tcache_max + 1, flags); + } else { + sz = sizeof(size_t); + assert_d_eq(mallctl("arenas.lrun.0.size", &large, &sz, NULL, 0), + 0, "Unexpected mallctl failure"); + } assert_d_eq(mallctl("arena.0.purge", NULL, NULL, NULL, 0), 0, "Unexpected mallctl failure"); |