summaryrefslogtreecommitdiffstats
path: root/test/integration/aligned_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/aligned_alloc.c')
-rw-r--r--test/integration/aligned_alloc.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/test/integration/aligned_alloc.c b/test/integration/aligned_alloc.c
index 5843842..536b67e 100644
--- a/test/integration/aligned_alloc.c
+++ b/test/integration/aligned_alloc.c
@@ -1,7 +1,6 @@
#include "test/jemalloc_test.h"
-#define CHUNK 0x400000
-#define MAXALIGN (((size_t)1) << 23)
+#define MAXALIGN (((size_t)1) << 23)
/*
* On systems which can't merge extents, tests that call this function generate
@@ -9,15 +8,12 @@
* potential OOM on e.g. 32-bit Windows.
*/
static void
-purge(void)
-{
-
+purge(void) {
assert_d_eq(mallctl("arena.0.purge", NULL, NULL, NULL, 0), 0,
"Unexpected mallctl error");
}
-TEST_BEGIN(test_alignment_errors)
-{
+TEST_BEGIN(test_alignment_errors) {
size_t alignment;
void *p;
@@ -38,8 +34,7 @@ TEST_BEGIN(test_alignment_errors)
}
TEST_END
-TEST_BEGIN(test_oom_errors)
-{
+TEST_BEGIN(test_oom_errors) {
size_t alignment, size;
void *p;
@@ -83,15 +78,15 @@ TEST_BEGIN(test_oom_errors)
}
TEST_END
-TEST_BEGIN(test_alignment_and_size)
-{
-#define NITER 4
+TEST_BEGIN(test_alignment_and_size) {
+#define NITER 4
size_t alignment, size, total;
unsigned i;
void *ps[NITER];
- for (i = 0; i < NITER; i++)
+ for (i = 0; i < NITER; i++) {
ps[i] = NULL;
+ }
for (alignment = 8;
alignment <= MAXALIGN;
@@ -112,8 +107,9 @@ TEST_BEGIN(test_alignment_and_size)
alignment, size, size, buf);
}
total += malloc_usable_size(ps[i]);
- if (total >= (MAXALIGN << 1))
+ if (total >= (MAXALIGN << 1)) {
break;
+ }
}
for (i = 0; i < NITER; i++) {
if (ps[i] != NULL) {
@@ -129,11 +125,9 @@ TEST_BEGIN(test_alignment_and_size)
TEST_END
int
-main(void)
-{
-
- return (test(
+main(void) {
+ return test(
test_alignment_errors,
test_oom_errors,
- test_alignment_and_size));
+ test_alignment_and_size);
}