Change heap API functions to the internal libc functions

This commit is contained in:
kalaposfos13 2025-07-16 12:57:45 +02:00
parent 25afeb3602
commit 91bde2cbfa

View File

@ -15,6 +15,7 @@
#include "core/devtools/widget/module_list.h"
#include "core/libraries/kernel/memory.h"
#include "core/libraries/kernel/threads.h"
#include "core/libraries/libc_internal/libc_internal_memory.h"
#include "core/linker.h"
#include "core/memory.h"
#include "core/tls.h"
@ -50,12 +51,12 @@ static PS4_SYSV_ABI void* RunMainEntry [[noreturn]] (EntryParams* params) {
#endif
Linker::Linker()
: memory{Memory::Instance()}, heap_api{new HeapAPI{.heap_malloc = &std::malloc,
.heap_free = &std::free,
.heap_calloc = &std::calloc,
.heap_realloc = &std::realloc,
: memory{Memory::Instance()}, heap_api{new HeapAPI{.heap_malloc = &Libraries::LibcInternal::internal_malloc,
.heap_free = &Libraries::LibcInternal::internal_free,
.heap_calloc = &Libraries::LibcInternal::internal_calloc,
.heap_realloc = &Libraries::LibcInternal::internal_realloc,
.heap_memalign = nullptr,
.heap_posix_memalign = nullptr,
.heap_posix_memalign = Libraries::LibcInternal::internal_posix_memalign,
.heap_reallocalign = nullptr,
.heap_malloc_stats = nullptr,
.heap_malloc_usable_size = nullptr}} {}