@@ -41,7 +41,7 @@ thd_start(void *arg) {
|
||||
assert_ptr_not_null(p, "Unexpected mallocx() error");
|
||||
dallocx(p, 0);
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_MALLOCX_ARENA) {
|
||||
@@ -61,6 +61,6 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
test_MALLOCX_ARENA));
|
||||
return test(
|
||||
test_MALLOCX_ARENA);
|
||||
}
|
||||
|
@@ -126,8 +126,8 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
return test(
|
||||
test_alignment_errors,
|
||||
test_oom_errors,
|
||||
test_alignment_and_size));
|
||||
test_alignment_and_size);
|
||||
}
|
||||
|
@@ -91,12 +91,12 @@ thd_start(void *arg) {
|
||||
"Deallocated memory counter should increase by at least the amount "
|
||||
"explicitly deallocated");
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
label_ENOENT:
|
||||
assert_false(config_stats,
|
||||
"ENOENT should only be returned if stats are disabled");
|
||||
test_skip("\"thread.allocated\" mallctl not available");
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_main_thread) {
|
||||
@@ -115,10 +115,10 @@ TEST_END
|
||||
int
|
||||
main(void) {
|
||||
/* Run tests multiple times to check for bad interactions. */
|
||||
return (test(
|
||||
return test(
|
||||
test_main_thread,
|
||||
test_subthread,
|
||||
test_main_thread,
|
||||
test_subthread,
|
||||
test_main_thread));
|
||||
test_main_thread);
|
||||
}
|
||||
|
@@ -20,6 +20,6 @@ TEST_END
|
||||
|
||||
int
|
||||
main() {
|
||||
return (test(
|
||||
test_basic));
|
||||
return test(
|
||||
test_basic);
|
||||
}
|
||||
|
@@ -174,7 +174,7 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
return test(
|
||||
test_extent_manual_hook,
|
||||
test_extent_auto_hook));
|
||||
test_extent_auto_hook);
|
||||
}
|
||||
|
@@ -13,12 +13,12 @@ get_nsizes_impl(const char *cmd) {
|
||||
assert_d_eq(mallctl(cmd, (void *)&ret, &z, NULL, 0), 0,
|
||||
"Unexpected mallctl(\"%s\", ...) failure", cmd);
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
get_nlarge(void) {
|
||||
return (get_nsizes_impl("arenas.nlextents"));
|
||||
return get_nsizes_impl("arenas.nlextents");
|
||||
}
|
||||
|
||||
static size_t
|
||||
@@ -36,12 +36,12 @@ get_size_impl(const char *cmd, size_t ind) {
|
||||
assert_d_eq(mallctlbymib(mib, miblen, (void *)&ret, &z, NULL, 0),
|
||||
0, "Unexpected mallctlbymib([\"%s\", %zu], ...) failure", cmd, ind);
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static size_t
|
||||
get_large_size(size_t ind) {
|
||||
return (get_size_impl("arenas.lextent.0.size", ind));
|
||||
return get_size_impl("arenas.lextent.0.size", ind);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -216,9 +216,9 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
return test(
|
||||
test_overflow,
|
||||
test_oom,
|
||||
test_basic,
|
||||
test_alignment_and_size));
|
||||
test_alignment_and_size);
|
||||
}
|
||||
|
@@ -41,6 +41,6 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
test_overflow));
|
||||
return test(
|
||||
test_overflow);
|
||||
}
|
||||
|
@@ -120,8 +120,8 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
return test(
|
||||
test_alignment_errors,
|
||||
test_oom_errors,
|
||||
test_alignment_and_size));
|
||||
test_alignment_and_size);
|
||||
}
|
||||
|
@@ -9,12 +9,12 @@ get_nsizes_impl(const char *cmd) {
|
||||
assert_d_eq(mallctl(cmd, (void *)&ret, &z, NULL, 0), 0,
|
||||
"Unexpected mallctl(\"%s\", ...) failure", cmd);
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
get_nlarge(void) {
|
||||
return (get_nsizes_impl("arenas.nlextents"));
|
||||
return get_nsizes_impl("arenas.nlextents");
|
||||
}
|
||||
|
||||
static size_t
|
||||
@@ -32,12 +32,12 @@ get_size_impl(const char *cmd, size_t ind) {
|
||||
assert_d_eq(mallctlbymib(mib, miblen, (void *)&ret, &z, NULL, 0),
|
||||
0, "Unexpected mallctlbymib([\"%s\", %zu], ...) failure", cmd, ind);
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static size_t
|
||||
get_large_size(size_t ind) {
|
||||
return (get_size_impl("arenas.lextent.0.size", ind));
|
||||
return get_size_impl("arenas.lextent.0.size", ind);
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_grow_and_shrink) {
|
||||
@@ -100,7 +100,7 @@ validate_fill(const void *p, uint8_t c, size_t offset, size_t len) {
|
||||
}
|
||||
}
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_zero) {
|
||||
@@ -236,10 +236,10 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
return test(
|
||||
test_grow_and_shrink,
|
||||
test_zero,
|
||||
test_align,
|
||||
test_lg_align_and_zero,
|
||||
test_overflow));
|
||||
test_overflow);
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
return test(
|
||||
test_basic,
|
||||
test_alignment_and_size));
|
||||
test_alignment_and_size);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ thd_start(void *arg) {
|
||||
assert_u_eq(arena_ind, main_arena_ind,
|
||||
"Arena index should be same as for main thread");
|
||||
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_thread_arena) {
|
||||
@@ -72,6 +72,6 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
test_thread_arena));
|
||||
return test(
|
||||
test_thread_arena);
|
||||
}
|
||||
|
@@ -77,10 +77,10 @@ thd_start(void *arg) {
|
||||
assert_false(e0, "tcache should be disabled");
|
||||
|
||||
free(malloc(1));
|
||||
return (NULL);
|
||||
return NULL;
|
||||
label_ENOENT:
|
||||
test_skip("\"thread.tcache.enabled\" mallctl not available");
|
||||
return (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_main_thread) {
|
||||
@@ -99,10 +99,10 @@ TEST_END
|
||||
int
|
||||
main(void) {
|
||||
/* Run tests multiple times to check for bad interactions. */
|
||||
return (test(
|
||||
return test(
|
||||
test_main_thread,
|
||||
test_subthread,
|
||||
test_main_thread,
|
||||
test_subthread,
|
||||
test_main_thread));
|
||||
test_main_thread);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ arena_ind(void) {
|
||||
0), 0, "Unexpected mallctl failure creating arena");
|
||||
}
|
||||
|
||||
return (ind);
|
||||
return ind;
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_same_size) {
|
||||
@@ -76,17 +76,17 @@ get_nsizes_impl(const char *cmd) {
|
||||
assert_d_eq(mallctl(cmd, (void *)&ret, &z, NULL, 0), 0,
|
||||
"Unexpected mallctl(\"%s\", ...) failure", cmd);
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
get_nsmall(void) {
|
||||
return (get_nsizes_impl("arenas.nbins"));
|
||||
return get_nsizes_impl("arenas.nbins");
|
||||
}
|
||||
|
||||
static unsigned
|
||||
get_nlarge(void) {
|
||||
return (get_nsizes_impl("arenas.nlextents"));
|
||||
return get_nsizes_impl("arenas.nlextents");
|
||||
}
|
||||
|
||||
static size_t
|
||||
@@ -104,17 +104,17 @@ get_size_impl(const char *cmd, size_t ind) {
|
||||
assert_d_eq(mallctlbymib(mib, miblen, (void *)&ret, &z, NULL, 0),
|
||||
0, "Unexpected mallctlbymib([\"%s\", %zu], ...) failure", cmd, ind);
|
||||
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static size_t
|
||||
get_small_size(size_t ind) {
|
||||
return (get_size_impl("arenas.bin.0.size", ind));
|
||||
return get_size_impl("arenas.bin.0.size", ind);
|
||||
}
|
||||
|
||||
static size_t
|
||||
get_large_size(size_t ind) {
|
||||
return (get_size_impl("arenas.lextent.0.size", ind));
|
||||
return get_size_impl("arenas.lextent.0.size", ind);
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_size) {
|
||||
@@ -312,7 +312,7 @@ validate_fill(const void *p, uint8_t c, size_t offset, size_t len) {
|
||||
print_filled_extents(p, c, offset + len);
|
||||
}
|
||||
|
||||
return (err);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -376,7 +376,7 @@ TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return (test(
|
||||
return test(
|
||||
test_same_size,
|
||||
test_extra_no_move,
|
||||
test_no_move_fail,
|
||||
@@ -384,5 +384,5 @@ main(void) {
|
||||
test_size_extra_overflow,
|
||||
test_extra_small,
|
||||
test_extra_large,
|
||||
test_zero_large));
|
||||
test_zero_large);
|
||||
}
|
||||
|
Reference in New Issue
Block a user