mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 19:00:17 +02:00
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.
31 lines
644 B
C++
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);
|
|
}
|