Files
FEX-Emu--FEX/Source/Windows/Common/CRT/Alloc.cpp
T
Ryan Houdek 985bdf2b6c 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.
2025-10-27 11:23:13 -07:00

31 lines
644 B
C++

// SPDX-License-Identifier: MIT
#define _SECIMP
#define _CRTIMP
#include <cstdint>
#include "../Priv.h"
#include <rpmalloc/rpmalloc.h>
void* calloc(size_t NumOfElements, size_t SizeOfElements) {
return ::rpcalloc(NumOfElements, SizeOfElements);
}
void free(void* Memory) {
::rpfree(Memory);
}
void* malloc(size_t Size) {
return ::rpmalloc(Size);
}
void* realloc(void* Memory, size_t NewSize) {
return ::rprealloc(Memory, NewSize);
}
DLLEXPORT_FUNC(void*, _aligned_malloc, (size_t Size, size_t Alignment)) {
return ::rpaligned_alloc(Alignment, Size);
}
DLLEXPORT_FUNC(void, _aligned_free, (void* Memory)) {
::rpfree(Memory);
}