]> granicus.if.org Git - libatomic_ops/commitdiff
New macro (DONT_USE_MMAP) to support testing as if mmap() is unavailable
authorIvan Maidanski <ivmai@mail.ru>
Tue, 19 Dec 2017 08:19:44 +0000 (11:19 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 19 Dec 2017 08:19:44 +0000 (11:19 +0300)
* 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
tests/test_malloc.c

index 06ed8330b41dc1d22491da073ca4bb248d706095..a8426cb5a80463a800f59ced6b975b84d9dbd29a 100644 (file)
 # include "config.h"
 #endif
 
+#ifdef DONT_USE_MMAP /* for testing */
+# undef HAVE_MMAP
+#endif
+
 #define AO_REQUIRE_CAS
 #include "atomic_ops_malloc.h"
 
index de80a2c05907b0ae864b7b7aa05486843e387684..c1a735203ca8f0b1ca6874bcf7a92c606a15a996 100644 (file)
 # include "config.h"
 #endif
 
+#ifdef DONT_USE_MMAP
+# undef HAVE_MMAP
+#endif
+
 #include "run_parallel.h"
 
 #include <stdlib.h>