MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / Setup48BitAllocatorIfExists

Function Setup48BitAllocatorIfExists

FEXCore/Source/Utils/Allocator.cpp:307–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307fextl::vector<MemoryRegion> Setup48BitAllocatorIfExists() {
308 size_t Bits = FEXCore::Allocator::DetermineVASize();
309 if (Bits < 48) {
310 return {};
311 }
312
313 uintptr_t Begin48BitVA = 0x0'8000'0000'0000ULL;
314 uintptr_t End48BitVA = 0x1'0000'0000'0000ULL;
315 auto Regions = StealMemoryRegion(Begin48BitVA, End48BitVA);
316
317 Alloc64 = Alloc::OSAllocator::Create64BitAllocatorWithRegions(Regions);
318 AssignHookOverrides();
319
320 return Regions;
321}
322
323void ReclaimMemoryRegion(const fextl::vector<MemoryRegion>& Regions) {
324 for (const auto& Region : Regions) {

Callers 1

mainFunction · 0.85

Calls 4

DetermineVASizeFunction · 0.85
StealMemoryRegionFunction · 0.85
AssignHookOverridesFunction · 0.85

Tested by

no test coverage detected