]>
git.saurik.com Git - redis.git/blob - deps/jemalloc/test/thread_tcache_enabled.c
1 #define JEMALLOC_MANGLE
2 #include "jemalloc_test.h"
5 je_thread_start(void *arg
)
12 if ((err
= mallctl("thread.tcache.enabled", &e0
, &sz
, NULL
, 0))) {
14 #ifdef JEMALLOC_TCACHE
23 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
)
29 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
33 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
37 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
41 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
46 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
51 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
56 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
61 assert(mallctl("thread.tcache.enabled", &e0
, &sz
, &e1
, sz
) == 0);
75 malloc_printf("Test begin\n");
77 je_thread_start(NULL
);
79 je_thread_create(&thread
, je_thread_start
, NULL
);
80 je_thread_join(thread
, (void *)&ret
);
82 je_thread_start(NULL
);
84 je_thread_create(&thread
, je_thread_start
, NULL
);
85 je_thread_join(thread
, (void *)&ret
);
87 je_thread_start(NULL
);
89 malloc_printf("Test end\n");