Revision: 1183
http://vcs.pcre.org/viewvc?view=rev&revision=1183
Author: zherczeg
Date: 2012-10-28 05:50:36 +0000 (Sun, 28 Oct 2012)
Log Message:
-----------
Change 0 to NULL for mmap in the JIT compiler.
Modified Paths:
--------------
code/trunk/sljit/sljitExecAllocator.c
code/trunk/sljit/sljitUtils.c
Modified: code/trunk/sljit/sljitExecAllocator.c
===================================================================
--- code/trunk/sljit/sljitExecAllocator.c 2012-10-28 05:22:32 UTC (rev 1182)
+++ code/trunk/sljit/sljitExecAllocator.c 2012-10-28 05:50:36 UTC (rev 1183)
@@ -99,13 +99,13 @@
void* retval;
#ifdef MAP_ANON
- retval = mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
+ retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
#else
if (dev_zero < 0) {
if (open_dev_zero())
return NULL;
}
- retval = mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero, 0);
+ retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero, 0);
#endif
return (retval != MAP_FAILED) ? retval : NULL;
Modified: code/trunk/sljit/sljitUtils.c
===================================================================
--- code/trunk/sljit/sljitUtils.c 2012-10-28 05:22:32 UTC (rev 1182)
+++ code/trunk/sljit/sljitUtils.c 2012-10-28 05:50:36 UTC (rev 1183)
@@ -251,7 +251,7 @@
}
#else
#ifdef MAP_ANON
- base.ptr = mmap(0, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ base.ptr = mmap(NULL, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
#else
if (dev_zero < 0) {
if (open_dev_zero()) {
@@ -259,7 +259,7 @@
return NULL;
}
}
- base.ptr = mmap(0, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE, dev_zero, 0);
+ base.ptr = mmap(NULL, max_limit, PROT_READ | PROT_WRITE, MAP_PRIVATE, dev_zero, 0);
#endif
if (base.ptr == MAP_FAILED) {
SLJIT_FREE(stack);