mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 01:38:37 +12:00
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:
parent
dcbe8ef5f4
commit
d1ee7c651f
4 changed files with 20 additions and 7 deletions
|
@ -186,12 +186,12 @@ namespace utils
|
|||
#endif
|
||||
}
|
||||
|
||||
void memory_lock(void* pointer, std::size_t size)
|
||||
bool memory_lock(void* pointer, std::size_t size)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
verify("VirtualLock" HERE), ::VirtualLock(pointer, size);
|
||||
return ::VirtualLock(pointer, size);
|
||||
#else
|
||||
verify("mlock" HERE), !::mlock(pointer, size);
|
||||
return !::mlock(pointer, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue