diff options
author | Jason Evans <jasone@canonware.com> | 2015-02-10 17:03:48 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2015-02-10 17:03:48 (GMT) |
commit | 9e561e8d3f3c625b98b57df069eeac0fa2f522fb (patch) | |
tree | 2d4cb64f9e6225daa145a6cc0ecd8e748c97f7db /test/unit | |
parent | 1cb181ed632e7573fb4eab194e4d216867222d27 (diff) | |
download | jemalloc-9e561e8d3f3c625b98b57df069eeac0fa2f522fb.zip jemalloc-9e561e8d3f3c625b98b57df069eeac0fa2f522fb.tar.gz jemalloc-9e561e8d3f3c625b98b57df069eeac0fa2f522fb.tar.bz2 |
Test and fix tcache ID recycling.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/mallctl.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/mallctl.c b/test/unit/mallctl.c index 10a6fcd..5960496 100644 --- a/test/unit/mallctl.c +++ b/test/unit/mallctl.c @@ -258,6 +258,18 @@ TEST_BEGIN(test_tcache) "Unexpected mallctl() failure, i=%u", i); } + /* Exercise tcache ID recycling. */ + for (i = 0; i < NTCACHES; i++) { + assert_d_eq(mallctl("tcache.destroy", NULL, NULL, &tis[i], + sizeof(unsigned)), 0, "Unexpected mallctl() failure, i=%u", + i); + } + for (i = 0; i < NTCACHES; i++) { + sz = sizeof(unsigned); + assert_d_eq(mallctl("tcache.create", &tis[i], &sz, NULL, 0), 0, + "Unexpected mallctl() failure, i=%u", i); + } + /* Flush empty tcaches. */ for (i = 0; i < NTCACHES; i++) { assert_d_eq(mallctl("tcache.flush", NULL, NULL, &tis[i], |