mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-15 17:36:21 +03:00
Test and fix tcache ID recycling.
This commit is contained in:
parent
1cb181ed63
commit
9e561e8d3f
2 changed files with 13 additions and 1 deletions
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue