mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-13 14:00:53 +02:00
These are required to expose FEX's allocators to the guest. Which is required when we are compiled with jemalloc, otherwise the libraries will crash on allocations. This needs to be done in stages otherwise glibc will load the library and as it is setting up symbols, replace malloc, which isn't set currently and cause a crash
24 lines
604 B
Python
24 lines
604 B
Python
#!/usr/bin/python3
|
|
from ThunkHelpers import *
|
|
|
|
lib("libfex_malloc")
|
|
|
|
# FEX
|
|
fn("void fex_get_allocation_ptrs(AllocationPtrs *)")
|
|
no_ldr()
|
|
|
|
# Memory allocators
|
|
|
|
fn("void free(void*)"); no_unpack()
|
|
fn("void *calloc(size_t, size_t)"); no_unpack()
|
|
fn("void *memalign(size_t, size_t)"); no_unpack()
|
|
fn("void *realloc(void*, size_t)"); no_unpack()
|
|
fn("void *valloc(size_t)"); no_unpack()
|
|
fn("int posix_memalign(void**, size_t, size_t)"); no_unpack()
|
|
fn("void *aligned_alloc(size_t, size_t)"); no_unpack()
|
|
fn("size_t malloc_usable_size(void *)"); no_unpack()
|
|
|
|
fn("void *malloc(size_t)"); no_unpack()
|
|
|
|
Generate()
|