From: Ivan Maidanski Date: Tue, 19 Dec 2017 08:19:44 +0000 (+0300) Subject: New macro (DONT_USE_MMAP) to support testing as if mmap() is unavailable X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f76d4727548372a40337fd2e9aed558f6ebadf83;p=libatomic_ops 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. --- diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c index 06ed833..a8426cb 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 de80a2c..c1a7352 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