zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH]: mem.c: make MAP_ANONYMOUS an alias to MAP_ANON (if not defined)
@ 2015-02-02 14:28 Jun T.
  0 siblings, 0 replies; only message in thread
From: Jun T. @ 2015-02-02 14:28 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-02 15:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 14:28 [PATCH]: mem.c: make MAP_ANONYMOUS an alias to MAP_ANON (if not defined) Jun T.

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).