Add protection to memory on Linux.

This commit is contained in:
Dario 2024-12-17 08:49:04 -03:00
parent dd23b2efc0
commit af8c01f590

View file

@ -13,6 +13,8 @@ Memory::Memory(void* address, size_t size) : size(size)
if (base == (char*)MAP_FAILED)
base = (char*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
mprotect(base, 4096, PROT_NONE);
#endif
}