Use Core::ExecuteGuest to execute allocator alloc and free

This commit is contained in:
Stephen Miller 2025-03-31 15:34:57 -05:00
parent 9f6335cba0
commit 519159c219

View File

@ -160,13 +160,13 @@ s32 PS4_SYSV_ABI sceNgs2SystemCreateWithAllocator(const OrbisNgs2SystemOption* o
result = SystemSetup(option, &bufferInfo, 0, 0); result = SystemSetup(option, &bufferInfo, 0, 0);
if (result >= 0) { if (result >= 0) {
uintptr_t sysUserData = allocator->userData; uintptr_t sysUserData = allocator->userData;
result = hostAlloc(&bufferInfo); result = Core::ExecuteGuest(hostAlloc, &bufferInfo);
if (result >= 0) { if (result >= 0) {
OrbisNgs2Handle* handleCopy = outHandle; OrbisNgs2Handle* handleCopy = outHandle;
result = SystemSetup(option, &bufferInfo, hostFree, handleCopy); result = SystemSetup(option, &bufferInfo, hostFree, handleCopy);
if (result < 0) { if (result < 0) {
if (hostFree) { if (hostFree) {
hostFree(&bufferInfo); Core::ExecuteGuest(hostFree, &bufferInfo);
} }
} }
} }