@@ -35,10 +35,10 @@
|
||||
*/
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define BLOCK_SIZE 10000
|
||||
#define BLOCK_SIZE64 (BLOCK_SIZE / 2)
|
||||
#define COUNT_1 1000
|
||||
#define COUNT_2 700
|
||||
#define BLOCK_SIZE 10000
|
||||
#define BLOCK_SIZE64 (BLOCK_SIZE / 2)
|
||||
#define COUNT_1 1000
|
||||
#define COUNT_2 700
|
||||
|
||||
static const uint32_t init_gen_rand_32_expected[] = {
|
||||
3440181298U, 1564997079U, 1510669302U, 2930277156U, 1452439940U,
|
||||
|
@@ -82,7 +82,7 @@ do_arena_create(extent_hooks_t *h) {
|
||||
|
||||
static void
|
||||
do_arena_reset_pre(unsigned arena_ind, void ***ptrs, unsigned *nptrs) {
|
||||
#define NLARGE 32
|
||||
#define NLARGE 32
|
||||
unsigned nsmall, nlarge, i;
|
||||
size_t sz;
|
||||
int flags;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
#define ARENA_RESET_PROF_C_
|
||||
#define ARENA_RESET_PROF_C_
|
||||
|
||||
const char *malloc_conf = "prof:true,lg_prof_sample:0";
|
||||
#include "arena_reset.c"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define TEST_STRUCT(p, t) \
|
||||
#define TEST_STRUCT(p, t) \
|
||||
struct p##_test_s { \
|
||||
t accum0; \
|
||||
t x; \
|
||||
@@ -8,7 +8,7 @@ struct p##_test_s { \
|
||||
}; \
|
||||
typedef struct p##_test_s p##_test_t;
|
||||
|
||||
#define TEST_BODY(p, t, tc, ta, FMT) do { \
|
||||
#define TEST_BODY(p, t, tc, ta, FMT) do { \
|
||||
const p##_test_t tests[] = { \
|
||||
{(t)-1, (t)-1, (t)-2}, \
|
||||
{(t)-1, (t) 0, (t)-2}, \
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define NBITS_TAB \
|
||||
#define NBITS_TAB \
|
||||
NB( 1) \
|
||||
NB( 2) \
|
||||
NB( 3) \
|
||||
@@ -124,7 +124,7 @@ test_bitmap_initializer_body(const bitmap_info_t *binfo, size_t nbits) {
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_bitmap_initializer) {
|
||||
#define NB(nbits) { \
|
||||
#define NB(nbits) { \
|
||||
if (nbits <= BITMAP_MAXBITS) { \
|
||||
bitmap_info_t binfo = \
|
||||
BITMAP_INFO_INITIALIZER(nbits); \
|
||||
@@ -155,7 +155,7 @@ TEST_BEGIN(test_bitmap_size) {
|
||||
bitmap_info_init(&binfo, nbits);
|
||||
prev_size = test_bitmap_size_body(&binfo, nbits, prev_size);
|
||||
}
|
||||
#define NB(nbits) { \
|
||||
#define NB(nbits) { \
|
||||
bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \
|
||||
prev_size = test_bitmap_size_body(&binfo, nbits, \
|
||||
prev_size); \
|
||||
@@ -188,7 +188,7 @@ TEST_BEGIN(test_bitmap_init) {
|
||||
bitmap_info_init(&binfo, nbits);
|
||||
test_bitmap_init_body(&binfo, nbits);
|
||||
}
|
||||
#define NB(nbits) { \
|
||||
#define NB(nbits) { \
|
||||
bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \
|
||||
test_bitmap_init_body(&binfo, nbits); \
|
||||
}
|
||||
@@ -219,7 +219,7 @@ TEST_BEGIN(test_bitmap_set) {
|
||||
bitmap_info_init(&binfo, nbits);
|
||||
test_bitmap_set_body(&binfo, nbits);
|
||||
}
|
||||
#define NB(nbits) { \
|
||||
#define NB(nbits) { \
|
||||
bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \
|
||||
test_bitmap_set_body(&binfo, nbits); \
|
||||
}
|
||||
@@ -257,7 +257,7 @@ TEST_BEGIN(test_bitmap_unset) {
|
||||
bitmap_info_init(&binfo, nbits);
|
||||
test_bitmap_unset_body(&binfo, nbits);
|
||||
}
|
||||
#define NB(nbits) { \
|
||||
#define NB(nbits) { \
|
||||
bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \
|
||||
test_bitmap_unset_body(&binfo, nbits); \
|
||||
}
|
||||
@@ -318,7 +318,7 @@ TEST_BEGIN(test_bitmap_sfu) {
|
||||
bitmap_info_init(&binfo, nbits);
|
||||
test_bitmap_sfu_body(&binfo, nbits);
|
||||
}
|
||||
#define NB(nbits) { \
|
||||
#define NB(nbits) { \
|
||||
bitmap_info_t binfo = BITMAP_INFO_INITIALIZER(nbits); \
|
||||
test_bitmap_sfu_body(&binfo, nbits); \
|
||||
}
|
||||
|
@@ -104,7 +104,7 @@ TEST_BEGIN(test_count_insert_search_remove) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_insert_iter_remove) {
|
||||
#define NITEMS ZU(1000)
|
||||
#define NITEMS ZU(1000)
|
||||
tsd_t *tsd;
|
||||
ckh_t ckh;
|
||||
void **p[NITEMS];
|
||||
|
@@ -196,7 +196,7 @@ TEST_BEGIN(test_decay_ticks) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_decay_ticker) {
|
||||
#define NPS 1024
|
||||
#define NPS 1024
|
||||
int flags = (MALLOCX_ARENA(0) | MALLOCX_TCACHE_NONE);
|
||||
void *ps[NPS];
|
||||
uint64_t epoch;
|
||||
@@ -289,7 +289,7 @@ TEST_BEGIN(test_decay_ticker) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_decay_nonmonotonic) {
|
||||
#define NPS (SMOOTHSTEP_NSTEPS + 1)
|
||||
#define NPS (SMOOTHSTEP_NSTEPS + 1)
|
||||
int flags = (MALLOCX_ARENA(0) | MALLOCX_TCACHE_NONE);
|
||||
void *ps[NPS];
|
||||
uint64_t epoch;
|
||||
|
@@ -99,7 +99,7 @@ TEST_BEGIN(test_large_extent_size) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_monotonic) {
|
||||
#define SZ_MAX ZU(4 * 1024 * 1024)
|
||||
#define SZ_MAX ZU(4 * 1024 * 1024)
|
||||
unsigned i;
|
||||
size_t floor_prev, ceil_prev;
|
||||
|
||||
|
@@ -55,7 +55,7 @@ hash_variant_string(hash_variant_t variant) {
|
||||
}
|
||||
}
|
||||
|
||||
#define KEY_SIZE 256
|
||||
#define KEY_SIZE 256
|
||||
static void
|
||||
hash_variant_verify_key(hash_variant_t variant, uint8_t *key) {
|
||||
const int hashbytes = hash_variant_bits(variant) / 8;
|
||||
@@ -137,7 +137,7 @@ hash_variant_verify_key(hash_variant_t variant, uint8_t *key) {
|
||||
|
||||
static void
|
||||
hash_variant_verify(hash_variant_t variant) {
|
||||
#define MAX_ALIGN 16
|
||||
#define MAX_ALIGN 16
|
||||
uint8_t key[KEY_SIZE + (MAX_ALIGN - 1)];
|
||||
unsigned i;
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#define JEMALLOC_TEST_JUNK_OPT "junk:alloc"
|
||||
#define JEMALLOC_TEST_JUNK_OPT "junk:alloc"
|
||||
#include "junk.c"
|
||||
#undef JEMALLOC_TEST_JUNK_OPT
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#define JEMALLOC_TEST_JUNK_OPT "junk:free"
|
||||
#define JEMALLOC_TEST_JUNK_OPT "junk:free"
|
||||
#include "junk.c"
|
||||
#undef JEMALLOC_TEST_JUNK_OPT
|
||||
|
@@ -115,7 +115,7 @@ TEST_BEGIN(test_mallctlnametomib_short_mib) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_mallctl_config) {
|
||||
#define TEST_MALLCTL_CONFIG(config, t) do { \
|
||||
#define TEST_MALLCTL_CONFIG(config, t) do { \
|
||||
t oldval; \
|
||||
size_t sz = sizeof(oldval); \
|
||||
assert_d_eq(mallctl("config."#config, (void *)&oldval, &sz, \
|
||||
@@ -146,7 +146,7 @@ TEST_END
|
||||
TEST_BEGIN(test_mallctl_opt) {
|
||||
bool config_always = true;
|
||||
|
||||
#define TEST_MALLCTL_OPT(t, opt, config) do { \
|
||||
#define TEST_MALLCTL_OPT(t, opt, config) do { \
|
||||
t oldval; \
|
||||
size_t sz = sizeof(oldval); \
|
||||
int expected = config_##config ? 0 : ENOENT; \
|
||||
@@ -232,7 +232,7 @@ TEST_BEGIN(test_tcache_none) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_tcache) {
|
||||
#define NTCACHES 10
|
||||
#define NTCACHES 10
|
||||
unsigned tis[NTCACHES];
|
||||
void *ps[NTCACHES];
|
||||
void *qs[NTCACHES];
|
||||
@@ -534,7 +534,7 @@ TEST_BEGIN(test_arenas_decay_time) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_arenas_constants) {
|
||||
#define TEST_ARENAS_CONSTANT(t, name, expected) do { \
|
||||
#define TEST_ARENAS_CONSTANT(t, name, expected) do { \
|
||||
t name; \
|
||||
size_t sz = sizeof(t); \
|
||||
assert_d_eq(mallctl("arenas."#name, (void *)&name, &sz, NULL, \
|
||||
@@ -552,7 +552,7 @@ TEST_BEGIN(test_arenas_constants) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_arenas_bin_constants) {
|
||||
#define TEST_ARENAS_BIN_CONSTANT(t, name, expected) do { \
|
||||
#define TEST_ARENAS_BIN_CONSTANT(t, name, expected) do { \
|
||||
t name; \
|
||||
size_t sz = sizeof(t); \
|
||||
assert_d_eq(mallctl("arenas.bin.0."#name, (void *)&name, &sz, \
|
||||
@@ -570,7 +570,7 @@ TEST_BEGIN(test_arenas_bin_constants) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_arenas_lextent_constants) {
|
||||
#define TEST_ARENAS_LEXTENT_CONSTANT(t, name, expected) do { \
|
||||
#define TEST_ARENAS_LEXTENT_CONSTANT(t, name, expected) do { \
|
||||
t name; \
|
||||
size_t sz = sizeof(t); \
|
||||
assert_d_eq(mallctl("arenas.lextent.0."#name, (void *)&name, \
|
||||
@@ -602,7 +602,7 @@ TEST_BEGIN(test_arenas_create) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_stats_arenas) {
|
||||
#define TEST_STATS_ARENAS(t, name) do { \
|
||||
#define TEST_STATS_ARENAS(t, name) do { \
|
||||
t name; \
|
||||
size_t sz = sizeof(t); \
|
||||
assert_d_eq(mallctl("stats.arenas.0."#name, (void *)&name, &sz, \
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define MAX_REL_ERR 1.0e-9
|
||||
#define MAX_ABS_ERR 1.0e-9
|
||||
#define MAX_REL_ERR 1.0e-9
|
||||
#define MAX_ABS_ERR 1.0e-9
|
||||
|
||||
#include <float.h>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef INFINITY
|
||||
#define INFINITY (DBL_MAX + DBL_MAX)
|
||||
#define INFINITY (DBL_MAX + DBL_MAX)
|
||||
#endif
|
||||
|
||||
static bool
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define NSENDERS 3
|
||||
#define NMSGS 100000
|
||||
#define NSENDERS 3
|
||||
#define NMSGS 100000
|
||||
|
||||
typedef struct mq_msg_s mq_msg_t;
|
||||
struct mq_msg_s {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define NTHREADS 2
|
||||
#define NINCRS 2000000
|
||||
#define NTHREADS 2
|
||||
#define NINCRS 2000000
|
||||
|
||||
TEST_BEGIN(test_mtx_basic) {
|
||||
mtx_t mtx;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define BILLION UINT64_C(1000000000)
|
||||
#define BILLION UINT64_C(1000000000)
|
||||
|
||||
TEST_BEGIN(test_nstime_init) {
|
||||
nstime_t nst;
|
||||
|
@@ -7,9 +7,9 @@ const char *malloc_conf = "decay_time:-1";
|
||||
* Size class that is a divisor of the page size, ideally 4+ regions per run.
|
||||
*/
|
||||
#if LG_PAGE <= 14
|
||||
#define SZ (ZU(1) << (LG_PAGE - 2))
|
||||
#define SZ (ZU(1) << (LG_PAGE - 2))
|
||||
#else
|
||||
#define SZ 4096
|
||||
#define SZ 4096
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -17,7 +17,7 @@ const char *malloc_conf = "decay_time:-1";
|
||||
* if mmap()ed memory grows downward, downward growth of mmap()ed memory is
|
||||
* tested.
|
||||
*/
|
||||
#define NSLABS 8
|
||||
#define NSLABS 8
|
||||
|
||||
static unsigned
|
||||
binind_compute(void) {
|
||||
|
@@ -3,7 +3,7 @@
|
||||
typedef struct node_s node_t;
|
||||
|
||||
struct node_s {
|
||||
#define NODE_MAGIC 0x9823af7e
|
||||
#define NODE_MAGIC 0x9823af7e
|
||||
uint32_t magic;
|
||||
phn(node_t) link;
|
||||
uint64_t key;
|
||||
@@ -160,9 +160,9 @@ node_remove_first(heap_t *heap) {
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_ph_random) {
|
||||
#define NNODES 25
|
||||
#define NBAGS 250
|
||||
#define SEED 42
|
||||
#define NNODES 25
|
||||
#define NBAGS 250
|
||||
#define SEED 42
|
||||
sfmt_t *sfmt;
|
||||
uint64_t bag[NNODES];
|
||||
heap_t heap;
|
||||
|
@@ -137,9 +137,9 @@ TEST_END
|
||||
static void
|
||||
test_prng_range_u32(bool atomic) {
|
||||
uint32_t range;
|
||||
#define MAX_RANGE 10000000
|
||||
#define RANGE_STEP 97
|
||||
#define NREPS 10
|
||||
#define MAX_RANGE 10000000
|
||||
#define RANGE_STEP 97
|
||||
#define NREPS 10
|
||||
|
||||
for (range = 2; range < MAX_RANGE; range += RANGE_STEP) {
|
||||
uint32_t s;
|
||||
@@ -157,9 +157,9 @@ test_prng_range_u32(bool atomic) {
|
||||
static void
|
||||
test_prng_range_u64(void) {
|
||||
uint64_t range;
|
||||
#define MAX_RANGE 10000000
|
||||
#define RANGE_STEP 97
|
||||
#define NREPS 10
|
||||
#define MAX_RANGE 10000000
|
||||
#define RANGE_STEP 97
|
||||
#define NREPS 10
|
||||
|
||||
for (range = 2; range < MAX_RANGE; range += RANGE_STEP) {
|
||||
uint64_t s;
|
||||
@@ -177,9 +177,9 @@ test_prng_range_u64(void) {
|
||||
static void
|
||||
test_prng_range_zu(bool atomic) {
|
||||
size_t range;
|
||||
#define MAX_RANGE 10000000
|
||||
#define RANGE_STEP 97
|
||||
#define NREPS 10
|
||||
#define MAX_RANGE 10000000
|
||||
#define RANGE_STEP 97
|
||||
#define NREPS 10
|
||||
|
||||
for (range = 2; range < MAX_RANGE; range += RANGE_STEP) {
|
||||
size_t s;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define NTHREADS 4
|
||||
#define NALLOCS_PER_THREAD 50
|
||||
#define DUMP_INTERVAL 1
|
||||
#define BT_COUNT_CHECK_INTERVAL 5
|
||||
#define NTHREADS 4
|
||||
#define NALLOCS_PER_THREAD 50
|
||||
#define DUMP_INTERVAL 1
|
||||
#define BT_COUNT_CHECK_INTERVAL 5
|
||||
|
||||
#ifdef JEMALLOC_PROF
|
||||
const char *malloc_conf =
|
||||
|
@@ -37,7 +37,7 @@ mallctl_prof_active_get_impl(bool prof_active_old_expected, const char *func,
|
||||
int line) {
|
||||
mallctl_bool_get("prof.active", prof_active_old_expected, func, line);
|
||||
}
|
||||
#define mallctl_prof_active_get(a) \
|
||||
#define mallctl_prof_active_get(a) \
|
||||
mallctl_prof_active_get_impl(a, __func__, __LINE__)
|
||||
|
||||
static void
|
||||
@@ -46,7 +46,7 @@ mallctl_prof_active_set_impl(bool prof_active_old_expected,
|
||||
mallctl_bool_set("prof.active", prof_active_old_expected,
|
||||
prof_active_new, func, line);
|
||||
}
|
||||
#define mallctl_prof_active_set(a, b) \
|
||||
#define mallctl_prof_active_set(a, b) \
|
||||
mallctl_prof_active_set_impl(a, b, __func__, __LINE__)
|
||||
|
||||
static void
|
||||
@@ -55,7 +55,7 @@ mallctl_thread_prof_active_get_impl(bool thread_prof_active_old_expected,
|
||||
mallctl_bool_get("thread.prof.active", thread_prof_active_old_expected,
|
||||
func, line);
|
||||
}
|
||||
#define mallctl_thread_prof_active_get(a) \
|
||||
#define mallctl_thread_prof_active_get(a) \
|
||||
mallctl_thread_prof_active_get_impl(a, __func__, __LINE__)
|
||||
|
||||
static void
|
||||
@@ -64,7 +64,7 @@ mallctl_thread_prof_active_set_impl(bool thread_prof_active_old_expected,
|
||||
mallctl_bool_set("thread.prof.active", thread_prof_active_old_expected,
|
||||
thread_prof_active_new, func, line);
|
||||
}
|
||||
#define mallctl_thread_prof_active_set(a, b) \
|
||||
#define mallctl_thread_prof_active_set(a, b) \
|
||||
mallctl_thread_prof_active_set_impl(a, b, __func__, __LINE__)
|
||||
|
||||
static void
|
||||
@@ -80,7 +80,7 @@ prof_sampling_probe_impl(bool expect_sample, const char *func, int line) {
|
||||
"%s():%d: Unexpected backtrace count", func, line);
|
||||
dallocx(p, 0);
|
||||
}
|
||||
#define prof_sampling_probe(a) \
|
||||
#define prof_sampling_probe(a) \
|
||||
prof_sampling_probe_impl(a, __func__, __LINE__)
|
||||
|
||||
TEST_BEGIN(test_prof_active) {
|
||||
|
@@ -135,11 +135,11 @@ TEST_BEGIN(test_prof_reset_cleanup) {
|
||||
}
|
||||
TEST_END
|
||||
|
||||
#define NTHREADS 4
|
||||
#define NALLOCS_PER_THREAD (1U << 13)
|
||||
#define OBJ_RING_BUF_COUNT 1531
|
||||
#define RESET_INTERVAL (1U << 10)
|
||||
#define DUMP_INTERVAL 3677
|
||||
#define NTHREADS 4
|
||||
#define NALLOCS_PER_THREAD (1U << 13)
|
||||
#define OBJ_RING_BUF_COUNT 1531
|
||||
#define RESET_INTERVAL (1U << 10)
|
||||
#define DUMP_INTERVAL 3677
|
||||
static void *
|
||||
thd_start(void *varg) {
|
||||
unsigned thd_ind = *(unsigned *)varg;
|
||||
@@ -228,7 +228,7 @@ TEST_END
|
||||
#undef DUMP_INTERVAL
|
||||
|
||||
/* Test sampling at the same allocation site across resets. */
|
||||
#define NITER 10
|
||||
#define NITER 10
|
||||
TEST_BEGIN(test_xallocx) {
|
||||
size_t lg_prof_sample_orig;
|
||||
unsigned i;
|
||||
|
@@ -18,7 +18,7 @@ mallctl_thread_name_get_impl(const char *thread_name_expected, const char *func,
|
||||
assert_str_eq(thread_name_old, thread_name_expected,
|
||||
"%s():%d: Unexpected thread.prof.name value", func, line);
|
||||
}
|
||||
#define mallctl_thread_name_get(a) \
|
||||
#define mallctl_thread_name_get(a) \
|
||||
mallctl_thread_name_get_impl(a, __func__, __LINE__)
|
||||
|
||||
static void
|
||||
@@ -30,7 +30,7 @@ mallctl_thread_name_set_impl(const char *thread_name, const char *func,
|
||||
func, line);
|
||||
mallctl_thread_name_get_impl(thread_name, func, line);
|
||||
}
|
||||
#define mallctl_thread_name_set(a) \
|
||||
#define mallctl_thread_name_set(a) \
|
||||
mallctl_thread_name_set_impl(a, __func__, __LINE__)
|
||||
|
||||
TEST_BEGIN(test_prof_thread_name_validation) {
|
||||
@@ -72,8 +72,8 @@ TEST_BEGIN(test_prof_thread_name_validation) {
|
||||
}
|
||||
TEST_END
|
||||
|
||||
#define NTHREADS 4
|
||||
#define NRESET 25
|
||||
#define NTHREADS 4
|
||||
#define NRESET 25
|
||||
static void *
|
||||
thd_start(void *varg) {
|
||||
unsigned thd_ind = *(unsigned *)varg;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
/* Number of ring entries, in [2..26]. */
|
||||
#define NENTRIES 9
|
||||
#define NENTRIES 9
|
||||
|
||||
typedef struct list_s list_t;
|
||||
typedef ql_head(list_t) list_head_t;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
/* Number of ring entries, in [2..26]. */
|
||||
#define NENTRIES 9
|
||||
#define NENTRIES 9
|
||||
/* Split index, in [1..NENTRIES). */
|
||||
#define SPLIT_INDEX 5
|
||||
#define SPLIT_INDEX 5
|
||||
|
||||
typedef struct ring_s ring_t;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define rbtn_black_height(a_type, a_field, a_rbt, r_height) do { \
|
||||
#define rbtn_black_height(a_type, a_field, a_rbt, r_height) do { \
|
||||
a_type *rbp_bh_t; \
|
||||
for (rbp_bh_t = (a_rbt)->rbt_root, (r_height) = 0; rbp_bh_t != \
|
||||
NULL; rbp_bh_t = rbtn_left_get(a_type, a_field, \
|
||||
@@ -14,7 +14,7 @@
|
||||
typedef struct node_s node_t;
|
||||
|
||||
struct node_s {
|
||||
#define NODE_MAGIC 0x9823af7e
|
||||
#define NODE_MAGIC 0x9823af7e
|
||||
uint32_t magic;
|
||||
rb_node(node_t) link;
|
||||
uint64_t key;
|
||||
@@ -223,9 +223,9 @@ destroy_cb(node_t *node, void *data) {
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_rb_random) {
|
||||
#define NNODES 25
|
||||
#define NBAGS 250
|
||||
#define SEED 42
|
||||
#define NNODES 25
|
||||
#define NBAGS 250
|
||||
#define SEED 42
|
||||
sfmt_t *sfmt;
|
||||
uint64_t bag[NNODES];
|
||||
tree_t tree;
|
||||
|
@@ -51,10 +51,10 @@ TEST_BEGIN(test_rtree_read_empty) {
|
||||
}
|
||||
TEST_END
|
||||
|
||||
#define NTHREADS 8
|
||||
#define MAX_NBITS 18
|
||||
#define NITERS 1000
|
||||
#define SEED 42
|
||||
#define NTHREADS 8
|
||||
#define MAX_NBITS 18
|
||||
#define NITERS 1000
|
||||
#define SEED 42
|
||||
|
||||
typedef struct {
|
||||
unsigned nbits;
|
||||
@@ -218,8 +218,8 @@ TEST_BEGIN(test_rtree_random) {
|
||||
unsigned i;
|
||||
sfmt_t *sfmt;
|
||||
tsdn_t *tsdn;
|
||||
#define NSET 16
|
||||
#define SEED 42
|
||||
#define NSET 16
|
||||
#define SEED 42
|
||||
|
||||
sfmt = init_gen_rand(SEED);
|
||||
tsdn = tsdn_fetch();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
static const uint64_t smoothstep_tab[] = {
|
||||
#define STEP(step, h, x, y) \
|
||||
#define STEP(step, h, x, y) \
|
||||
h,
|
||||
SMOOTHSTEP
|
||||
#undef STEP
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
TEST_BEGIN(test_ticker_tick) {
|
||||
#define NREPS 2
|
||||
#define NTICKS 3
|
||||
#define NREPS 2
|
||||
#define NTICKS 3
|
||||
ticker_t ticker;
|
||||
int32_t i, j;
|
||||
|
||||
@@ -26,7 +26,7 @@ TEST_BEGIN(test_ticker_tick) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_ticker_ticks) {
|
||||
#define NTICKS 3
|
||||
#define NTICKS 3
|
||||
ticker_t ticker;
|
||||
|
||||
ticker_init(&ticker, NTICKS);
|
||||
@@ -44,7 +44,7 @@ TEST_BEGIN(test_ticker_ticks) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_ticker_copy) {
|
||||
#define NTICKS 3
|
||||
#define NTICKS 3
|
||||
ticker_t ta, tb;
|
||||
|
||||
ticker_init(&ta, NTICKS);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define THREAD_DATA 0x72b65c10
|
||||
#define THREAD_DATA 0x72b65c10
|
||||
|
||||
typedef unsigned int data_t;
|
||||
|
||||
@@ -47,7 +47,7 @@ data_cleanup(void *arg) {
|
||||
}
|
||||
|
||||
malloc_tsd_externs(data_, data_t)
|
||||
#define DATA_INIT 0x12345678
|
||||
#define DATA_INIT 0x12345678
|
||||
malloc_tsd_data(, data_, data_t, DATA_INIT)
|
||||
malloc_tsd_funcs(, data_, data_t, DATA_INIT, data_cleanup)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#define TEST_POW2_CEIL(t, suf, pri) do { \
|
||||
#define TEST_POW2_CEIL(t, suf, pri) do { \
|
||||
unsigned i, pow2; \
|
||||
t x; \
|
||||
\
|
||||
@@ -65,9 +65,9 @@ TEST_BEGIN(test_malloc_strtoumax) {
|
||||
const char *expected_errno_name;
|
||||
uintmax_t expected_x;
|
||||
};
|
||||
#define ERR(e) e, #e
|
||||
#define KUMAX(x) ((uintmax_t)x##ULL)
|
||||
#define KSMAX(x) ((uintmax_t)(intmax_t)x##LL)
|
||||
#define ERR(e) e, #e
|
||||
#define KUMAX(x) ((uintmax_t)x##ULL)
|
||||
#define KSMAX(x) ((uintmax_t)(intmax_t)x##LL)
|
||||
struct test_s tests[] = {
|
||||
{"0", "0", -1, ERR(EINVAL), UINTMAX_MAX},
|
||||
{"0", "0", 1, ERR(EINVAL), UINTMAX_MAX},
|
||||
@@ -151,11 +151,11 @@ TEST_BEGIN(test_malloc_strtoumax) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_malloc_snprintf_truncated) {
|
||||
#define BUFLEN 15
|
||||
#define BUFLEN 15
|
||||
char buf[BUFLEN];
|
||||
size_t result;
|
||||
size_t len;
|
||||
#define TEST(expected_str_untruncated, ...) do { \
|
||||
#define TEST(expected_str_untruncated, ...) do { \
|
||||
result = malloc_snprintf(buf, len, __VA_ARGS__); \
|
||||
assert_d_eq(strncmp(buf, expected_str_untruncated, len-1), 0, \
|
||||
"Unexpected string inequality (\"%s\" vs \"%s\")", \
|
||||
@@ -183,10 +183,10 @@ TEST_BEGIN(test_malloc_snprintf_truncated) {
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_malloc_snprintf) {
|
||||
#define BUFLEN 128
|
||||
#define BUFLEN 128
|
||||
char buf[BUFLEN];
|
||||
size_t result;
|
||||
#define TEST(expected_str, ...) do { \
|
||||
#define TEST(expected_str, ...) do { \
|
||||
result = malloc_snprintf(buf, sizeof(buf), __VA_ARGS__); \
|
||||
assert_str_eq(buf, expected_str, "Unexpected output"); \
|
||||
assert_zu_eq(result, strlen(expected_str), "Unexpected result");\
|
||||
|
@@ -9,7 +9,7 @@ static void
|
||||
test_zero(size_t sz_min, size_t sz_max) {
|
||||
uint8_t *s;
|
||||
size_t sz_prev, sz, i;
|
||||
#define MAGIC ((uint8_t)0x61)
|
||||
#define MAGIC ((uint8_t)0x61)
|
||||
|
||||
sz_prev = 0;
|
||||
s = (uint8_t *)mallocx(sz_min, 0);
|
||||
|
Reference in New Issue
Block a user