MCPcopy Create free account
hub / github.com/decaf-emu/decaf-emu / commitMemory

Function commitMemory

src/common/src/platform_win_memory.cpp:231–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229
230
231bool
232commitMemory(uintptr_t address,
233 size_t size,
234 ProtectFlags flags)
235{
236 auto baseAddress = reinterpret_cast<LPVOID>(address);
237 auto result = VirtualAlloc(baseAddress,
238 size,
239 MEM_COMMIT,
240 flagsToPageProtect(flags));
241
242 if (result != baseAddress) {
243 gLog->error("commitMemory(address: 0x{:X}, size: 0x{:X}, flags: {}) failed with error: {}",
244 address, size, static_cast<int>(flags), GetLastError());
245 return false;
246 }
247
248 return true;
249}
250
251
252bool

Callers 1

allocateMethod · 0.50

Calls 2

flagsToPageProtectFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected