Experimental squashing of reservation memory area.
Enables trivial synchronization between shared mem. Reduces memory usage, but potentially degrades performance. Rename an overload of vm::passive_lock to vm::range_lock.
This commit is contained in:
@@ -141,8 +141,9 @@ namespace utils
|
||||
#endif
|
||||
}
|
||||
|
||||
shm::shm(u32 size)
|
||||
shm::shm(u32 size, u32 flags)
|
||||
: m_size(::align(size, 0x10000))
|
||||
, m_flags(flags)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
m_handle = ::CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_EXECUTE_READWRITE, 0, m_size, NULL);
|
||||
|
||||
@@ -48,9 +48,10 @@ namespace utils
|
||||
int m_file;
|
||||
#endif
|
||||
u32 m_size;
|
||||
u32 m_flags;
|
||||
|
||||
public:
|
||||
explicit shm(u32 size);
|
||||
explicit shm(u32 size, u32 flags = 0);
|
||||
|
||||
shm(const shm&) = delete;
|
||||
|
||||
@@ -74,5 +75,11 @@ namespace utils
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
// Flags are unspecified, consider it userdata
|
||||
u32 flags() const
|
||||
{
|
||||
return m_flags;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user