Merge pull request #10447 from ctiller/arena

Fix arena_test on 32-bit platforms (includes Windows)
pull/9860/merge
Craig Tiller 8 years ago committed by GitHub
commit 14af85e8d2
  1. 8
      test/core/support/arena_test.c

@ -83,9 +83,13 @@ static void test(const char *name, size_t init_size, const size_t *allocs,
static const size_t allocs_##name[] = {__VA_ARGS__}; \
test(#name, init_size, allocs_##name, GPR_ARRAY_SIZE(allocs_##name))
#define CONCURRENT_TEST_ITERATIONS 100000
#define CONCURRENT_TEST_THREADS 100
size_t concurrent_test_iterations() {
if (sizeof(void *) < 8) return 1000;
return 100000;
}
typedef struct {
gpr_event ev_start;
gpr_arena *arena;
@ -94,7 +98,7 @@ typedef struct {
static void concurrent_test_body(void *arg) {
concurrent_test_args *a = arg;
gpr_event_wait(&a->ev_start, gpr_inf_future(GPR_CLOCK_REALTIME));
for (size_t i = 0; i < CONCURRENT_TEST_ITERATIONS; i++) {
for (size_t i = 0; i < concurrent_test_iterations(); i++) {
*(char *)gpr_arena_alloc(a->arena, 1) = (char)i;
}
}

Loading…
Cancel
Save