summaryrefslogtreecommitdiffstats
path: root/test/integration/MALLOCX_ARENA.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/MALLOCX_ARENA.c')
-rw-r--r--test/integration/MALLOCX_ARENA.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/test/integration/MALLOCX_ARENA.c b/test/integration/MALLOCX_ARENA.c
index 910a096..222164d 100644
--- a/test/integration/MALLOCX_ARENA.c
+++ b/test/integration/MALLOCX_ARENA.c
@@ -1,6 +1,6 @@
#include "test/jemalloc_test.h"
-#define NTHREADS 10
+#define NTHREADS 10
static bool have_dss =
#ifdef JEMALLOC_DSS
@@ -11,16 +11,15 @@ static bool have_dss =
;
void *
-thd_start(void *arg)
-{
+thd_start(void *arg) {
unsigned thread_ind = (unsigned)(uintptr_t)arg;
unsigned arena_ind;
void *p;
size_t sz;
sz = sizeof(arena_ind);
- assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0),
- 0, "Error in arenas.extend");
+ assert_d_eq(mallctl("arenas.create", (void *)&arena_ind, &sz, NULL, 0),
+ 0, "Error in arenas.create");
if (thread_ind % 4 != 3) {
size_t mib[3];
@@ -42,11 +41,10 @@ thd_start(void *arg)
assert_ptr_not_null(p, "Unexpected mallocx() error");
dallocx(p, 0);
- return (NULL);
+ return NULL;
}
-TEST_BEGIN(test_MALLOCX_ARENA)
-{
+TEST_BEGIN(test_MALLOCX_ARENA) {
thd_t thds[NTHREADS];
unsigned i;
@@ -55,15 +53,14 @@ TEST_BEGIN(test_MALLOCX_ARENA)
(void *)(uintptr_t)i);
}
- for (i = 0; i < NTHREADS; i++)
+ for (i = 0; i < NTHREADS; i++) {
thd_join(thds[i], NULL);
+ }
}
TEST_END
int
-main(void)
-{
-
- return (test(
- test_MALLOCX_ARENA));
+main(void) {
+ return test(
+ test_MALLOCX_ARENA);
}