Skip to content

Commit

Permalink
Windows: Fix overcommit size logic in the wine path
Browse files Browse the repository at this point in the history
  • Loading branch information
bylaws committed Jan 14, 2025
1 parent 11fc49a commit f5decb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Windows/Common/OvercommitTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class OvercommitTracker {
if (IsWine) {
MEMORY_BASIC_INFORMATION Info;
NtQueryVirtualMemory(NtCurrentProcess(), reinterpret_cast<void*>(FaultAddress), MemoryBasicInformation, &Info, sizeof(Info), nullptr);
const auto CommitSize = reinterpret_cast<SIZE_T>(Info.BaseAddress) + Info.RegionSize - FaultAddress;
const auto CommitSize = reinterpret_cast<SIZE_T>(Info.BaseAddress) + Info.RegionSize - reinterpret_cast<SIZE_T>(Info.AllocationBase);
VirtualAlloc(reinterpret_cast<void*>(Info.AllocationBase), CommitSize, MEM_COMMIT, PAGE_READWRITE);
} else {
static constexpr size_t MaxFaultCommitSize = 1024 * 64;
Expand Down

0 comments on commit f5decb5

Please sign in to comment.