Skip to content
Permalink
Browse files

mmap wrappers: enable PROT_MAX for systems which will support it.

For non "JITable" usage, no need of potential promotion than
the initial permissions.
  • Loading branch information...
devnexen committed Jun 28, 2019
1 parent a74e79c commit e1b591a87af9b39234f4e57223f672eb15bb4250
Showing with 4 additions and 1 deletion.
  1. +4 −1 wrappers/mmapwrapper.h
@@ -48,7 +48,10 @@ extern "C" int madvise (caddr_t, size_t, int);
#if HL_EXECUTABLE_HEAP
#define HL_MMAP_PROTECTION_MASK (PROT_READ | PROT_WRITE | PROT_EXEC)
#else
#define HL_MMAP_PROTECTION_MASK (PROT_READ | PROT_WRITE)
#if !defined(PROT_MAX)
#define PROT_MAX(p) 0
#endif
#define HL_MMAP_PROTECTION_MASK (PROT_READ | PROT_WRITE | PROT_MAX(PROT_READ | PROT_WRITE))
#endif
#endif

0 comments on commit e1b591a

Please sign in to comment.
You can’t perform that action at this time.