mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix compatibility issues with Illumos.
Thanks to Theo Schlossnagle.
This commit is contained in:
parent
49d3157e14
commit
7fb503dc86
@ -179,11 +179,17 @@ static LJ_AINLINE int CALL_MUNMAP(void *ptr, size_t size)
|
|||||||
|
|
||||||
#if defined(MAP_32BIT)
|
#if defined(MAP_32BIT)
|
||||||
|
|
||||||
|
#if defined(__sun__)
|
||||||
|
#define MMAP_REGION_START ((uintptr_t)0x1000)
|
||||||
|
#else
|
||||||
/* Actually this only gives us max. 1GB in current Linux kernels. */
|
/* Actually this only gives us max. 1GB in current Linux kernels. */
|
||||||
|
#define MMAP_REGION_START ((uintptr_t)0)
|
||||||
|
#endif
|
||||||
|
|
||||||
static LJ_AINLINE void *CALL_MMAP(size_t size)
|
static LJ_AINLINE void *CALL_MMAP(size_t size)
|
||||||
{
|
{
|
||||||
int olderr = errno;
|
int olderr = errno;
|
||||||
void *ptr = mmap(NULL, size, MMAP_PROT, MAP_32BIT|MMAP_FLAGS, -1, 0);
|
void *ptr = mmap((void *)MMAP_REGION_START, size, MMAP_PROT, MAP_32BIT|MMAP_FLAGS, -1, 0);
|
||||||
errno = olderr;
|
errno = olderr;
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user