Make memory locking optional (mlock, VirtualLock).

Fix desired locking operation (to fix "sudo" memory).
It was discovered that some systems have outdated configuration.
With too tight limit, it's almost impossible to lock anything in memory.
This commit is contained in:
Nekotekina 2020-11-10 05:56:29 +03:00
parent dcbe8ef5f4
commit d1ee7c651f
4 changed files with 20 additions and 7 deletions

View file

@ -40,7 +40,7 @@ namespace utils
void memory_protect(void* pointer, std::size_t size, protection prot);
// Lock pages in memory
void memory_lock(void* pointer, std::size_t size);
bool memory_lock(void* pointer, std::size_t size);
// Shared memory handle
class shm