diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-04-27 19:16:45 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-04-27 19:16:45 +0200 |
commit | 43034a36e132ac4394e26cbfb4d855bd6f5114b3 (patch) | |
tree | aee5502c6b17283b80ff2bf0706f97622df5d355 /memory/jemalloc/src/test/integration/thread_arena.c | |
parent | 077c63084488ac38c1c44e8cdaa9c33086f0a649 (diff) | |
download | UXP-43034a36e132ac4394e26cbfb4d855bd6f5114b3.tar UXP-43034a36e132ac4394e26cbfb4d855bd6f5114b3.tar.gz UXP-43034a36e132ac4394e26cbfb4d855bd6f5114b3.tar.lz UXP-43034a36e132ac4394e26cbfb4d855bd6f5114b3.tar.xz UXP-43034a36e132ac4394e26cbfb4d855bd6f5114b3.zip |
Remove jemalloc 4 from our tree.
Diffstat (limited to 'memory/jemalloc/src/test/integration/thread_arena.c')
-rw-r--r-- | memory/jemalloc/src/test/integration/thread_arena.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/memory/jemalloc/src/test/integration/thread_arena.c b/memory/jemalloc/src/test/integration/thread_arena.c deleted file mode 100644 index 67be53513..000000000 --- a/memory/jemalloc/src/test/integration/thread_arena.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "test/jemalloc_test.h" - -#define NTHREADS 10 - -void * -thd_start(void *arg) -{ - unsigned main_arena_ind = *(unsigned *)arg; - void *p; - unsigned arena_ind; - size_t size; - int err; - - p = malloc(1); - assert_ptr_not_null(p, "Error in malloc()"); - free(p); - - size = sizeof(arena_ind); - if ((err = mallctl("thread.arena", &arena_ind, &size, &main_arena_ind, - sizeof(main_arena_ind)))) { - char buf[BUFERROR_BUF]; - - buferror(err, buf, sizeof(buf)); - test_fail("Error in mallctl(): %s", buf); - } - - size = sizeof(arena_ind); - if ((err = mallctl("thread.arena", &arena_ind, &size, NULL, 0))) { - char buf[BUFERROR_BUF]; - - buferror(err, buf, sizeof(buf)); - test_fail("Error in mallctl(): %s", buf); - } - assert_u_eq(arena_ind, main_arena_ind, - "Arena index should be same as for main thread"); - - return (NULL); -} - -TEST_BEGIN(test_thread_arena) -{ - void *p; - unsigned arena_ind; - size_t size; - int err; - thd_t thds[NTHREADS]; - unsigned i; - - p = malloc(1); - assert_ptr_not_null(p, "Error in malloc()"); - - size = sizeof(arena_ind); - if ((err = mallctl("thread.arena", &arena_ind, &size, NULL, 0))) { - char buf[BUFERROR_BUF]; - - buferror(err, buf, sizeof(buf)); - test_fail("Error in mallctl(): %s", buf); - } - - for (i = 0; i < NTHREADS; i++) { - thd_create(&thds[i], thd_start, - (void *)&arena_ind); - } - - for (i = 0; i < NTHREADS; i++) { - intptr_t join_ret; - thd_join(thds[i], (void *)&join_ret); - assert_zd_eq(join_ret, 0, "Unexpected thread join error"); - } -} -TEST_END - -int -main(void) -{ - - return (test( - test_thread_arena)); -} |