diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_alloc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lj_alloc.c b/src/lj_alloc.c index b381bba1..f856a7a0 100644 --- a/src/lj_alloc.c +++ b/src/lj_alloc.c | |||
@@ -188,7 +188,7 @@ static LJ_AINLINE void *CALL_MMAP(size_t size) | |||
188 | return ptr; | 188 | return ptr; |
189 | } | 189 | } |
190 | 190 | ||
191 | #elif LJ_TARGET_OSX || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun__) | 191 | #elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun__) |
192 | 192 | ||
193 | /* OSX and FreeBSD mmap() use a naive first-fit linear search. | 193 | /* OSX and FreeBSD mmap() use a naive first-fit linear search. |
194 | ** That's perfect for us. Except that -pagezero_size must be set for OSX, | 194 | ** That's perfect for us. Except that -pagezero_size must be set for OSX, |
@@ -197,12 +197,14 @@ static LJ_AINLINE void *CALL_MMAP(size_t size) | |||
197 | */ | 197 | */ |
198 | #if LJ_TARGET_OSX | 198 | #if LJ_TARGET_OSX |
199 | #define MMAP_REGION_START ((uintptr_t)0x10000) | 199 | #define MMAP_REGION_START ((uintptr_t)0x10000) |
200 | #elif LJ_TARGET_PS4 | ||
201 | #define MMAP_REGION_START ((uintptr_t)0x4000) | ||
200 | #else | 202 | #else |
201 | #define MMAP_REGION_START ((uintptr_t)0x10000000) | 203 | #define MMAP_REGION_START ((uintptr_t)0x10000000) |
202 | #endif | 204 | #endif |
203 | #define MMAP_REGION_END ((uintptr_t)0x80000000) | 205 | #define MMAP_REGION_END ((uintptr_t)0x80000000) |
204 | 206 | ||
205 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | 207 | #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !LJ_TARGET_PS4 |
206 | #include <sys/resource.h> | 208 | #include <sys/resource.h> |
207 | #endif | 209 | #endif |
208 | 210 | ||
@@ -212,7 +214,7 @@ static LJ_AINLINE void *CALL_MMAP(size_t size) | |||
212 | /* Hint for next allocation. Doesn't need to be thread-safe. */ | 214 | /* Hint for next allocation. Doesn't need to be thread-safe. */ |
213 | static uintptr_t alloc_hint = MMAP_REGION_START; | 215 | static uintptr_t alloc_hint = MMAP_REGION_START; |
214 | int retry = 0; | 216 | int retry = 0; |
215 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | 217 | #if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !LJ_TARGET_PS4 |
216 | static int rlimit_modified = 0; | 218 | static int rlimit_modified = 0; |
217 | if (LJ_UNLIKELY(rlimit_modified == 0)) { | 219 | if (LJ_UNLIKELY(rlimit_modified == 0)) { |
218 | struct rlimit rlim; | 220 | struct rlimit rlim; |