Skip to content

Commit 1cb42ae

Browse files
util: modify Win32LockedPageAllocator to query windows for limit
1 parent e3c08eb commit 1cb42ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/support/lockedpool.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ void Win32LockedPageAllocator::FreeLocked(void* addr, size_t len)
202202

203203
size_t Win32LockedPageAllocator::GetLimit()
204204
{
205-
// TODO is there a limit on Windows, how to get it?
205+
size_t min, max;
206+
if(GetProcessWorkingSetSize(GetCurrentProcess(), &min, &max) != 0) {
207+
return min;
208+
}
206209
return std::numeric_limits<size_t>::max();
207210
}
208211
#endif

0 commit comments

Comments
 (0)