more checks of NO_MMAP

This commit is contained in:
dzaima 2022-06-12 22:12:08 +03:00
parent ab69f86cb5
commit 5a32a00f46
2 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ B path_list(B path) {
return res;
}
#if __has_include(<sys/mman.h>) && __has_include(<fcntl.h>) && __has_include(<errno.h>) && __has_include(<unistd.h>) && !WASM
#if __has_include(<sys/mman.h>) && __has_include(<fcntl.h>) && __has_include(<errno.h>) && __has_include(<unistd.h>) && !WASM && !NO_MMAP
#include <sys/mman.h>
#include <fcntl.h>

View File

@ -1056,7 +1056,7 @@ static void allocStack(void** curr, void** start, void** end, i32 elSize, i32 co
#endif
*curr = *start = mem;
*end = ((char*)*start)+sz;
#if !WASM
#if !WASM && !NO_MMAP
mprotect(*end, ps, PROT_NONE); // idk first way i found to force erroring on overflow
#endif
}