Switch over to rpmalloc instead of jemalloc.

rpmalloc is currently very aggressively configured which causes
significant reductions in resident memory over jemalloc.

In Bayonetta's title screen it went from 963MB down to 834MB resident.
This commit is contained in:
Ryan Houdek committed 2026-02-10 08:28:51 -08:00
1 parent 0a6e13b153
commit 98617a4ba5
11 files changed
+232 -96

No files matched your search

+9 -9
View File
@@ -81,21 +81,21 @@ int FEX_munmap(void* addr, size_t length) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
static void AssignHookOverrides() {
SetJemallocMmapHook(FEX_mmap);
SetJemallocMunmapHook(FEX_munmap);
static void AssignHookOverrides(size_t PageSize) {
SetupAllocatorHooks(FEX_mmap, FEX_munmap);
FEXCore::Allocator::mmap = FEX_mmap;
FEXCore::Allocator::munmap = FEX_munmap;
InitializeAllocator(PageSize);
}
void SetupHooks() {
void SetupHooks(size_t PageSize) {
Alloc64 = Alloc::OSAllocator::Create64BitAllocator();
AssignHookOverrides();
AssignHookOverrides(PageSize);
}
void ClearHooks() {
SetJemallocMmapHook(::mmap);
SetJemallocMunmapHook(::munmap);
SetupAllocatorHooks(::mmap, ::munmap);
FEXCore::Allocator::mmap = ::mmap;
FEXCore::Allocator::munmap = ::munmap;
@@ -271,7 +271,7 @@ fextl::vector<MemoryRegion> StealMemoryRegion(uintptr_t Begin, uintptr_t End) {
return Regions;
}
fextl::vector<MemoryRegion> Setup48BitAllocatorIfExists() {
fextl::vector<MemoryRegion> Setup48BitAllocatorIfExists(size_t PageSize) {
size_t Bits = FEXCore::Allocator::DetermineVASize();
if (Bits < 48) {
return {};
@@ -282,7 +282,7 @@ fextl::vector<MemoryRegion> Setup48BitAllocatorIfExists() {
auto Regions = StealMemoryRegion(Begin48BitVA, End48BitVA);
Alloc64 = Alloc::OSAllocator::Create64BitAllocatorWithRegions(Regions);
AssignHookOverrides();
AssignHookOverrides(PageSize);
return Regions;
}