From ad191ceba3885ec1d4fd04e569c6f886d0738f82 Mon Sep 17 00:00:00 2001 From: John Esmet Date: Wed, 17 Apr 2013 00:01:27 -0400 Subject: [PATCH] use the XMALLOC_N_ALIGNED API in portability git-svn-id: file:///svn/toku/tokudb@52286 c7de825b-a66e-492c-adef-691d508d4ae1 --- src/tests/threaded_stress_test_helpers.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/tests/threaded_stress_test_helpers.h b/src/tests/threaded_stress_test_helpers.h index b841462149f..aedf0ea7d1c 100644 --- a/src/tests/threaded_stress_test_helpers.h +++ b/src/tests/threaded_stress_test_helpers.h @@ -43,24 +43,6 @@ #include #include -// TODO: Move me to portability/memory.cc and toku_include/memory.h -#if defined(HAVE_MALLOC_H) -# include -#elif defined(HAVE_SYS_MALLOC_H) -# include -#endif -#if !defined(HAVE_MEMALIGN) -# if defined(HAVE_VALLOC) -static void * -memalign(size_t UU(alignment), size_t size) -{ - return valloc(size); -} -# else -# error "no suitable aligned malloc available (checked memalign and valloc)" -# endif -#endif - static const size_t min_val_size = sizeof(int32_t); static const size_t min_key_size = sizeof(int32_t); @@ -1534,8 +1516,8 @@ static int run_workers( if (cli_args->print_performance) { perf_formatter->header(cli_args, num_threads); } - struct worker_extra *worker_extra = (struct worker_extra *) - memalign(64, num_threads * sizeof (struct worker_extra)); // allocate worker_extra's on cache line boundaries + // allocate worker_extra's on cache line boundaries + struct worker_extra *XMALLOC_N_ALIGNED(64, num_threads, worker_extra); struct test_time_extra tte; tte.num_seconds = num_seconds; tte.crash_at_end = crash_at_end;