Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH]: mem.c: make MAP_ANONYMOUS an alias to MAP_ANON (if not defined)
- X-seq: zsh-workers 34451
- From: "Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH]: mem.c: make MAP_ANONYMOUS an alias to MAP_ANON (if not defined)
- Date: Mon, 2 Feb 2015 23:28:21 +0900
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
On Mac OS X, MAP_ANON is defined but MAP_ANONYMOUS is not,
resulting that mmap() is not used for allocating the zsh heap.
The following fixes this, although I'm not sure using malloc()
really leads to (higher probability of) memory fragmentation.
diff --git a/Src/mem.c b/Src/mem.c
index 7e0667a..b9569ea 100644
--- a/Src/mem.c
+++ b/Src/mem.c
@@ -79,6 +79,10 @@
#include <sys/mman.h>
+#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
#if defined(MAP_ANONYMOUS) && defined(MAP_PRIVATE)
#define USE_MMAP 1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author