diff --git a/core/libs/prx/libc/src/ApplicationHeap.cpp b/core/libs/prx/libc/src/ApplicationHeap.cpp index ffd62cc5a..81e17250d 100644 --- a/core/libs/prx/libc/src/ApplicationHeap.cpp +++ b/core/libs/prx/libc/src/ApplicationHeap.cpp @@ -142,7 +142,7 @@ void* ApplicationHeapReallocate_nid_no_patch(void* pointer, std::size_t bytes) { ApplicationHeapFree_nid_no_patch(pointer); return nullptr; } - const auto reallocate = callback(2); + const auto reallocate = callback(3); CallbackScope scope; return requireAllocation(reallocate(pointer, bytes)); } @@ -158,7 +158,7 @@ void* ApplicationHeapAlign_nid_no_patch(std::size_t alignment, std::size_t bytes void* ApplicationHeapCalloc_nid_no_patch(std::size_t count, std::size_t bytes) { if (bytes != 0 && count > std::numeric_limits::max() / bytes) throw std::length_error("application heap: calloc size overflow"); - const auto calloc = callback(3); + const auto calloc = callback(2); CallbackScope scope; return requireAllocation(calloc(count, bytes)); } diff --git a/core/libs/tests/ApplicationHeap.cpp b/core/libs/tests/ApplicationHeap.cpp index 0d4a8e900..48009f88e 100644 --- a/core/libs/tests/ApplicationHeap.cpp +++ b/core/libs/tests/ApplicationHeap.cpp @@ -87,8 +87,8 @@ int main(int argc, char**) { write(replacement, 0x18, &finalize); write(replacement, 0x20, &allocate); write(replacement, 0x28, &release); - write(replacement, 0x30, &reallocate); - write(replacement, 0x38, &allocateZeroed); + write(replacement, 0x30, &allocateZeroed); + write(replacement, 0x38, &reallocate); write(replacement, 0x40, &align); write(replacement, 0x48, &reallocate); write(replacement, 0x50, &posixAlign);