]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
zone: Do a straight malloc on non-Windows
authorCloudwalk <cloudwalk009@gmail.com>
Tue, 20 Jul 2021 18:03:39 +0000 (14:03 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Tue, 20 Jul 2021 18:03:39 +0000 (14:03 -0400)
zone.c

diff --git a/zone.c b/zone.c
index b357a013aeec18f0c7d491a081608c37c6c764c7..60598cd8ab2a8895f683311b26c568264a3026d1 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -146,6 +146,9 @@ static void mmap_free(void *mem)
 // (Windows growing its swapfile for example)
 static void *attempt_malloc(size_t size)
 {
 // (Windows growing its swapfile for example)
 static void *attempt_malloc(size_t size)
 {
+#ifndef WIN32
+       return malloc(size);
+#else
        void *base;
        // try for half a second or so
        unsigned int attempts = 500;
        void *base;
        // try for half a second or so
        unsigned int attempts = 500;
@@ -157,6 +160,7 @@ static void *attempt_malloc(size_t size)
                Sys_Sleep(1000);
        }
        return NULL;
                Sys_Sleep(1000);
        }
        return NULL;
+#endif
 }
 #endif
 
 }
 #endif