From 001b2756b36f38d04e5fcf1f4c80b961683a8f77 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 19 Dec 2017 11:19:44 +0300 Subject: [PATCH] New macro (DONT_USE_MMAP) to support testing as if mmap() is unavailable * src/atomic_ops_malloc.c [DONT_USE_MMAP] (HAVE_MMAP): Undefine (after including config.h). * tests/test_malloc.c [DONT_USE_MMAP] (HAVE_MMAP): Likewise. --- src/atomic_ops_malloc.c | 4 ++++ tests/test_malloc.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c index f78ff40..7cc7ada 100644 --- a/src/atomic_ops_malloc.c +++ b/src/atomic_ops_malloc.c @@ -15,6 +15,10 @@ # include "config.h" #endif +#ifdef DONT_USE_MMAP /* for testing */ +# undef HAVE_MMAP +#endif + #define AO_REQUIRE_CAS #include "atomic_ops_malloc.h" diff --git a/tests/test_malloc.c b/tests/test_malloc.c index 111e231..f799430 100644 --- a/tests/test_malloc.c +++ b/tests/test_malloc.c @@ -15,6 +15,10 @@ # include "config.h" #endif +#ifdef DONT_USE_MMAP +# undef HAVE_MMAP +#endif + #include "run_parallel.h" #include -- 2.7.4