]> granicus.if.org Git - libatomic_ops/commitdiff
Do not test CHUNK_SIZE allocation if no mmap() available (test_malloc)
authorIvan Maidanski <ivmai@mail.ru>
Tue, 19 Dec 2017 09:05:01 +0000 (12:05 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 19 Dec 2017 09:05:01 +0000 (12:05 +0300)
(fix commit 29d91db)

* tests/test_malloc.c (main): Do not call AO_malloc(CHUNK_SIZE) unless
HAVE_MMAP.

tests/test_malloc.c

index c1a735203ca8f0b1ca6874bcf7a92c606a15a996..f799430f7a0f61124e403b30271474e699913b93 100644 (file)
@@ -247,7 +247,9 @@ int main(int argc, char **argv) {
     /* Test various corner cases. */
     AO_free(NULL);
     AO_free(AO_malloc(0));
-    AO_free(AO_malloc(CHUNK_SIZE - (sizeof(AO_t)-1))); /* large alloc */
+#   ifdef HAVE_MMAP
+      AO_free(AO_malloc(CHUNK_SIZE - (sizeof(AO_t)-1))); /* large alloc */
+#   endif
 
     run_parallel(nthreads, run_one_test, dummy_test, "AO_malloc/AO_free");
     return 0;