summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rwxr-xr-x[-rw-r--r--]test/integration/MALLOCX_ARENA.c4
-rwxr-xr-x[-rw-r--r--]test/integration/allocated.c17
-rw-r--r--test/integration/chunk.c35
-rwxr-xr-x[-rw-r--r--]test/integration/mallocx.c4
-rwxr-xr-x[-rw-r--r--]test/integration/overflow.c8
-rwxr-xr-x[-rw-r--r--]test/integration/rallocx.c4
-rw-r--r--test/integration/sdallocx.c4
-rwxr-xr-x[-rw-r--r--]test/integration/thread_arena.c10
-rwxr-xr-x[-rw-r--r--]test/integration/thread_tcache_enabled.c39
-rwxr-xr-x[-rw-r--r--]test/integration/xallocx.c8
10 files changed, 69 insertions, 64 deletions
diff --git a/test/integration/MALLOCX_ARENA.c b/test/integration/MALLOCX_ARENA.c
index 30c203a..910a096 100644..100755
--- a/test/integration/MALLOCX_ARENA.c
+++ b/test/integration/MALLOCX_ARENA.c
@@ -19,8 +19,8 @@ thd_start(void *arg)
size_t sz;
sz = sizeof(arena_ind);
- assert_d_eq(mallctl("arenas.extend", &arena_ind, &sz, NULL, 0), 0,
- "Error in arenas.extend");
+ assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0),
+ 0, "Error in arenas.extend");
if (thread_ind % 4 != 3) {
size_t mib[3];
diff --git a/test/integration/allocated.c b/test/integration/allocated.c
index 3630e80..6ce145b 100644..100755
--- a/test/integration/allocated.c
+++ b/test/integration/allocated.c
@@ -18,14 +18,14 @@ thd_start(void *arg)
size_t sz, usize;
sz = sizeof(a0);
- if ((err = mallctl("thread.allocated", &a0, &sz, NULL, 0))) {
+ if ((err = mallctl("thread.allocated", (void *)&a0, &sz, NULL, 0))) {
if (err == ENOENT)
goto label_ENOENT;
test_fail("%s(): Error in mallctl(): %s", __func__,
strerror(err));
}
sz = sizeof(ap0);
- if ((err = mallctl("thread.allocatedp", &ap0, &sz, NULL, 0))) {
+ if ((err = mallctl("thread.allocatedp", (void *)&ap0, &sz, NULL, 0))) {
if (err == ENOENT)
goto label_ENOENT;
test_fail("%s(): Error in mallctl(): %s", __func__,
@@ -36,14 +36,15 @@ thd_start(void *arg)
"storage");
sz = sizeof(d0);
- if ((err = mallctl("thread.deallocated", &d0, &sz, NULL, 0))) {
+ if ((err = mallctl("thread.deallocated", (void *)&d0, &sz, NULL, 0))) {
if (err == ENOENT)
goto label_ENOENT;
test_fail("%s(): Error in mallctl(): %s", __func__,
strerror(err));
}
sz = sizeof(dp0);
- if ((err = mallctl("thread.deallocatedp", &dp0, &sz, NULL, 0))) {
+ if ((err = mallctl("thread.deallocatedp", (void *)&dp0, &sz, NULL,
+ 0))) {
if (err == ENOENT)
goto label_ENOENT;
test_fail("%s(): Error in mallctl(): %s", __func__,
@@ -57,9 +58,9 @@ thd_start(void *arg)
assert_ptr_not_null(p, "Unexpected malloc() error");
sz = sizeof(a1);
- mallctl("thread.allocated", &a1, &sz, NULL, 0);
+ mallctl("thread.allocated", (void *)&a1, &sz, NULL, 0);
sz = sizeof(ap1);
- mallctl("thread.allocatedp", &ap1, &sz, NULL, 0);
+ mallctl("thread.allocatedp", (void *)&ap1, &sz, NULL, 0);
assert_u64_eq(*ap1, a1,
"Dereferenced \"thread.allocatedp\" value should equal "
"\"thread.allocated\" value");
@@ -74,9 +75,9 @@ thd_start(void *arg)
free(p);
sz = sizeof(d1);
- mallctl("thread.deallocated", &d1, &sz, NULL, 0);
+ mallctl("thread.deallocated", (void *)&d1, &sz, NULL, 0);
sz = sizeof(dp1);
- mallctl("thread.deallocatedp", &dp1, &sz, NULL, 0);
+ mallctl("thread.deallocatedp", (void *)&dp1, &sz, NULL, 0);
assert_u64_eq(*dp1, d1,
"Dereferenced \"thread.deallocatedp\" value should equal "
"\"thread.deallocated\" value");
diff --git a/test/integration/chunk.c b/test/integration/chunk.c
index ff9bf96..94cf002 100644
--- a/test/integration/chunk.c
+++ b/test/integration/chunk.c
@@ -137,8 +137,8 @@ TEST_BEGIN(test_chunk)
bool xallocx_success_a, xallocx_success_b, xallocx_success_c;
sz = sizeof(unsigned);
- assert_d_eq(mallctl("arenas.extend", &arena_ind, &sz, NULL, 0), 0,
- "Unexpected mallctl() failure");
+ assert_d_eq(mallctl("arenas.extend", (void *)&arena_ind, &sz, NULL, 0),
+ 0, "Unexpected mallctl() failure");
flags = MALLOCX_ARENA(arena_ind) | MALLOCX_TCACHE_NONE;
/* Install custom chunk hooks. */
@@ -148,8 +148,9 @@ TEST_BEGIN(test_chunk)
hooks_mib[1] = (size_t)arena_ind;
old_size = sizeof(chunk_hooks_t);
new_size = sizeof(chunk_hooks_t);
- assert_d_eq(mallctlbymib(hooks_mib, hooks_miblen, &old_hooks, &old_size,
- &new_hooks, new_size), 0, "Unexpected chunk_hooks error");
+ assert_d_eq(mallctlbymib(hooks_mib, hooks_miblen, (void *)&old_hooks,
+ &old_size, (void *)&new_hooks, new_size), 0,
+ "Unexpected chunk_hooks error");
orig_hooks = old_hooks;
assert_ptr_ne(old_hooks.alloc, chunk_alloc, "Unexpected alloc error");
assert_ptr_ne(old_hooks.dalloc, chunk_dalloc,
@@ -164,18 +165,18 @@ TEST_BEGIN(test_chunk)
/* Get large size classes. */
sz = sizeof(size_t);
- assert_d_eq(mallctl("arenas.lrun.0.size", &large0, &sz, NULL, 0), 0,
- "Unexpected arenas.lrun.0.size failure");
- assert_d_eq(mallctl("arenas.lrun.1.size", &large1, &sz, NULL, 0), 0,
- "Unexpected arenas.lrun.1.size failure");
+ assert_d_eq(mallctl("arenas.lrun.0.size", (void *)&large0, &sz, NULL,
+ 0), 0, "Unexpected arenas.lrun.0.size failure");
+ assert_d_eq(mallctl("arenas.lrun.1.size", (void *)&large1, &sz, NULL,
+ 0), 0, "Unexpected arenas.lrun.1.size failure");
/* Get huge size classes. */
- assert_d_eq(mallctl("arenas.hchunk.0.size", &huge0, &sz, NULL, 0), 0,
- "Unexpected arenas.hchunk.0.size failure");
- assert_d_eq(mallctl("arenas.hchunk.1.size", &huge1, &sz, NULL, 0), 0,
- "Unexpected arenas.hchunk.1.size failure");
- assert_d_eq(mallctl("arenas.hchunk.2.size", &huge2, &sz, NULL, 0), 0,
- "Unexpected arenas.hchunk.2.size failure");
+ assert_d_eq(mallctl("arenas.hchunk.0.size", (void *)&huge0, &sz, NULL,
+ 0), 0, "Unexpected arenas.hchunk.0.size failure");
+ assert_d_eq(mallctl("arenas.hchunk.1.size", (void *)&huge1, &sz, NULL,
+ 0), 0, "Unexpected arenas.hchunk.1.size failure");
+ assert_d_eq(mallctl("arenas.hchunk.2.size", (void *)&huge2, &sz, NULL,
+ 0), 0, "Unexpected arenas.hchunk.2.size failure");
/* Test dalloc/decommit/purge cascade. */
purge_miblen = sizeof(purge_mib)/sizeof(size_t);
@@ -265,9 +266,9 @@ TEST_BEGIN(test_chunk)
/* Restore chunk hooks. */
assert_d_eq(mallctlbymib(hooks_mib, hooks_miblen, NULL, NULL,
- &old_hooks, new_size), 0, "Unexpected chunk_hooks error");
- assert_d_eq(mallctlbymib(hooks_mib, hooks_miblen, &old_hooks, &old_size,
- NULL, 0), 0, "Unexpected chunk_hooks error");
+ (void *)&old_hooks, new_size), 0, "Unexpected chunk_hooks error");
+ assert_d_eq(mallctlbymib(hooks_mib, hooks_miblen, (void *)&old_hooks,
+ &old_size, NULL, 0), 0, "Unexpected chunk_hooks error");
assert_ptr_eq(old_hooks.alloc, orig_hooks.alloc,
"Unexpected alloc error");
assert_ptr_eq(old_hooks.dalloc, orig_hooks.dalloc,
diff --git a/test/integration/mallocx.c b/test/integration/mallocx.c
index 43b76eb..d709eb3 100644..100755
--- a/test/integration/mallocx.c
+++ b/test/integration/mallocx.c
@@ -11,7 +11,7 @@ get_nsizes_impl(const char *cmd)
size_t z;
z = sizeof(unsigned);
- assert_d_eq(mallctl(cmd, &ret, &z, NULL, 0), 0,
+ assert_d_eq(mallctl(cmd, (void *)&ret, &z, NULL, 0), 0,
"Unexpected mallctl(\"%s\", ...) failure", cmd);
return (ret);
@@ -37,7 +37,7 @@ get_size_impl(const char *cmd, size_t ind)
0, "Unexpected mallctlnametomib(\"%s\", ...) failure", cmd);
mib[2] = ind;
z = sizeof(size_t);
- assert_d_eq(mallctlbymib(mib, miblen, &ret, &z, NULL, 0),
+ assert_d_eq(mallctlbymib(mib, miblen, (void *)&ret, &z, NULL, 0),
0, "Unexpected mallctlbymib([\"%s\", %zu], ...) failure", cmd, ind);
return (ret);
diff --git a/test/integration/overflow.c b/test/integration/overflow.c
index 303d9b2..84a3565 100644..100755
--- a/test/integration/overflow.c
+++ b/test/integration/overflow.c
@@ -8,8 +8,8 @@ TEST_BEGIN(test_overflow)
void *p;
sz = sizeof(unsigned);
- assert_d_eq(mallctl("arenas.nhchunks", &nhchunks, &sz, NULL, 0), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("arenas.nhchunks", (void *)&nhchunks, &sz, NULL, 0),
+ 0, "Unexpected mallctl() error");
miblen = sizeof(mib) / sizeof(size_t);
assert_d_eq(mallctlnametomib("arenas.hchunk.0.size", mib, &miblen), 0,
@@ -17,8 +17,8 @@ TEST_BEGIN(test_overflow)
mib[2] = nhchunks - 1;
sz = sizeof(size_t);
- assert_d_eq(mallctlbymib(mib, miblen, &max_size_class, &sz, NULL, 0), 0,
- "Unexpected mallctlbymib() error");
+ assert_d_eq(mallctlbymib(mib, miblen, (void *)&max_size_class, &sz,
+ NULL, 0), 0, "Unexpected mallctlbymib() error");
assert_ptr_null(malloc(max_size_class + 1),
"Expected OOM due to over-sized allocation request");
diff --git a/test/integration/rallocx.c b/test/integration/rallocx.c
index 66ad866..506bf1c 100644..100755
--- a/test/integration/rallocx.c
+++ b/test/integration/rallocx.c
@@ -7,7 +7,7 @@ get_nsizes_impl(const char *cmd)
size_t z;
z = sizeof(unsigned);
- assert_d_eq(mallctl(cmd, &ret, &z, NULL, 0), 0,
+ assert_d_eq(mallctl(cmd, (void *)&ret, &z, NULL, 0), 0,
"Unexpected mallctl(\"%s\", ...) failure", cmd);
return (ret);
@@ -33,7 +33,7 @@ get_size_impl(const char *cmd, size_t ind)
0, "Unexpected mallctlnametomib(\"%s\", ...) failure", cmd);
mib[2] = ind;
z = sizeof(size_t);
- assert_d_eq(mallctlbymib(mib, miblen, &ret, &z, NULL, 0),
+ assert_d_eq(mallctlbymib(mib, miblen, (void *)&ret, &z, NULL, 0),
0, "Unexpected mallctlbymib([\"%s\", %zu], ...) failure", cmd, ind);
return (ret);
diff --git a/test/integration/sdallocx.c b/test/integration/sdallocx.c
index b84817d..f92e058 100644
--- a/test/integration/sdallocx.c
+++ b/test/integration/sdallocx.c
@@ -1,7 +1,7 @@
#include "test/jemalloc_test.h"
-#define MAXALIGN (((size_t)1) << 25)
-#define NITER 4
+#define MAXALIGN (((size_t)1) << 22)
+#define NITER 3
TEST_BEGIN(test_basic)
{
diff --git a/test/integration/thread_arena.c b/test/integration/thread_arena.c
index 67be535..7a35a63 100644..100755
--- a/test/integration/thread_arena.c
+++ b/test/integration/thread_arena.c
@@ -16,8 +16,8 @@ thd_start(void *arg)
free(p);
size = sizeof(arena_ind);
- if ((err = mallctl("thread.arena", &arena_ind, &size, &main_arena_ind,
- sizeof(main_arena_ind)))) {
+ if ((err = mallctl("thread.arena", (void *)&arena_ind, &size,
+ (void *)&main_arena_ind, sizeof(main_arena_ind)))) {
char buf[BUFERROR_BUF];
buferror(err, buf, sizeof(buf));
@@ -25,7 +25,8 @@ thd_start(void *arg)
}
size = sizeof(arena_ind);
- if ((err = mallctl("thread.arena", &arena_ind, &size, NULL, 0))) {
+ if ((err = mallctl("thread.arena", (void *)&arena_ind, &size, NULL,
+ 0))) {
char buf[BUFERROR_BUF];
buferror(err, buf, sizeof(buf));
@@ -50,7 +51,8 @@ TEST_BEGIN(test_thread_arena)
assert_ptr_not_null(p, "Error in malloc()");
size = sizeof(arena_ind);
- if ((err = mallctl("thread.arena", &arena_ind, &size, NULL, 0))) {
+ if ((err = mallctl("thread.arena", (void *)&arena_ind, &size, NULL,
+ 0))) {
char buf[BUFERROR_BUF];
buferror(err, buf, sizeof(buf));
diff --git a/test/integration/thread_tcache_enabled.c b/test/integration/thread_tcache_enabled.c
index f4e89c6..2c2825e 100644..100755
--- a/test/integration/thread_tcache_enabled.c
+++ b/test/integration/thread_tcache_enabled.c
@@ -16,7 +16,8 @@ thd_start(void *arg)
bool e0, e1;
sz = sizeof(bool);
- if ((err = mallctl("thread.tcache.enabled", &e0, &sz, NULL, 0))) {
+ if ((err = mallctl("thread.tcache.enabled", (void *)&e0, &sz, NULL,
+ 0))) {
if (err == ENOENT) {
assert_false(config_tcache,
"ENOENT should only be returned if tcache is "
@@ -27,53 +28,53 @@ thd_start(void *arg)
if (e0) {
e1 = false;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz),
- 0, "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_true(e0, "tcache should be enabled");
}
e1 = true;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_false(e0, "tcache should be disabled");
e1 = true;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_true(e0, "tcache should be enabled");
e1 = false;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_true(e0, "tcache should be enabled");
e1 = false;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_false(e0, "tcache should be disabled");
free(malloc(1));
e1 = true;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_false(e0, "tcache should be disabled");
free(malloc(1));
e1 = true;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_true(e0, "tcache should be enabled");
free(malloc(1));
e1 = false;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_true(e0, "tcache should be enabled");
free(malloc(1));
e1 = false;
- assert_d_eq(mallctl("thread.tcache.enabled", &e0, &sz, &e1, sz), 0,
- "Unexpected mallctl() error");
+ assert_d_eq(mallctl("thread.tcache.enabled", (void *)&e0, &sz,
+ (void *)&e1, sz), 0, "Unexpected mallctl() error");
assert_false(e0, "tcache should be disabled");
free(malloc(1));
diff --git a/test/integration/xallocx.c b/test/integration/xallocx.c
index ad292bb..67e0a0e 100644..100755
--- a/test/integration/xallocx.c
+++ b/test/integration/xallocx.c
@@ -16,8 +16,8 @@ arena_ind(void)
if (ind == 0) {
size_t sz = sizeof(ind);
- assert_d_eq(mallctl("arenas.extend", &ind, &sz, NULL, 0), 0,
- "Unexpected mallctl failure creating arena");
+ assert_d_eq(mallctl("arenas.extend", (void *)&ind, &sz, NULL,
+ 0), 0, "Unexpected mallctl failure creating arena");
}
return (ind);
@@ -78,7 +78,7 @@ get_nsizes_impl(const char *cmd)
size_t z;
z = sizeof(unsigned);
- assert_d_eq(mallctl(cmd, &ret, &z, NULL, 0), 0,
+ assert_d_eq(mallctl(cmd, (void *)&ret, &z, NULL, 0), 0,
"Unexpected mallctl(\"%s\", ...) failure", cmd);
return (ret);
@@ -118,7 +118,7 @@ get_size_impl(const char *cmd, size_t ind)
0, "Unexpected mallctlnametomib(\"%s\", ...) failure", cmd);
mib[2] = ind;
z = sizeof(size_t);
- assert_d_eq(mallctlbymib(mib, miblen, &ret, &z, NULL, 0),
+ assert_d_eq(mallctlbymib(mib, miblen, (void *)&ret, &z, NULL, 0),
0, "Unexpected mallctlbymib([\"%s\", %zu], ...) failure", cmd, ind);
return (ret);