X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=lib%2Fmemcpy.c;h=8164ba0913e45880341c67c528a2cff2f0a1e0d6;hp=f937dd9f3cafd80cc97be8ce8b80138e0671ba91;hb=2226ce346557b79b85de46e5bb47b9102f709180;hpb=6fe147de8c17112b323b99d6064f3d0fda39b700;ds=sidebyside diff --git a/lib/memcpy.c b/lib/memcpy.c index f937dd9f..8164ba09 100644 --- a/lib/memcpy.c +++ b/lib/memcpy.c @@ -187,9 +187,9 @@ static int setup_tests(void) void *src, *dst; int i; - if (posix_memalign(&src, page_size, BUF_SIZE)) - return 1; - if (posix_memalign(&dst, page_size, BUF_SIZE)) + src = malloc(BUF_SIZE); + dst = malloc(BUF_SIZE); + if (!src || !dst) return 1; init_rand_seed(&state, 0x8989, 0); @@ -204,6 +204,12 @@ static int setup_tests(void) return 0; } +static void free_tests(void) +{ + free(tests[0].src); + free(tests[0].dst); +} + int fio_memcpy_test(const char *type) { unsigned int test_mask = 0; @@ -259,5 +265,6 @@ int fio_memcpy_test(const char *type) } } + free_tests(); return 0; }