From 8000ff491a621b024f4b569bb633239e98dfbd71 Mon Sep 17 00:00:00 2001 From: dbalatoni13 <40299962+dbalatoni13@users.noreply.github.com> Date: Thu, 3 Apr 2025 23:11:54 +0200 Subject: [PATCH] Fix types and aarch --- include/game/jmp.h | 4 ++-- include/game/memory.h | 10 +++++----- src/game/memory.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/game/jmp.h b/include/game/jmp.h index 3569a306..cc3da85a 100755 --- a/include/game/jmp.h +++ b/include/game/jmp.h @@ -76,7 +76,7 @@ typedef struct _JUMP_BUFFER { uint32_t Fpscr; uint32_t long D[8]; // D8-D15 VFP/NEON regs } _JUMP_BUFFER; -#elif defined(_M_ARM64) || defined(__arch64__) +#elif defined(_M_ARM64) || defined(__aarch64__) typedef struct _JUMP_BUFFER { uint64_t Frame; uint64_t Reserved; @@ -139,7 +139,7 @@ typedef struct _JUMP_BUFFER { #elif defined(_M_ARM) || defined(__arm__) #define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Pc = (size_t)func #define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (size_t)sp -#elif defined(_M_ARM64) || defined(__arch64__) +#elif defined(_M_ARM64) || defined(__aarch64__) #define SETJMP_SET_IP(jump, func) ((_JUMP_BUFFER *)((jump)))->Lr = (size_t)func #define SETJMP_SET_SP(jump, sp) ((_JUMP_BUFFER *)((jump)))->Sp = (size_t)sp #elif defined(__riscv) diff --git a/include/game/memory.h b/include/game/memory.h index 95728bde..c5978975 100644 --- a/include/game/memory.h +++ b/include/game/memory.h @@ -28,14 +28,14 @@ u32 HuMemHeapSizeGet(HeapID heap); void *HuMemHeapPtrGet(HeapID heap); void *HuMemHeapInit(void *ptr, s32 size); -void *HuMemMemoryAlloc(void *heap_ptr, s32 size, u32 retaddr); -void *HuMemMemoryAllocNum(void *heap_ptr, s32 size, u32 num, u32 retaddr); -void HuMemMemoryFree(void *ptr, u32 retaddr); -void HuMemMemoryFreeNum(void *heap_ptr, u32 num, u32 retaddr); +void *HuMemMemoryAlloc(void *heap_ptr, s32 size, size_t retaddr); +void *HuMemMemoryAllocNum(void *heap_ptr, s32 size, u32 num, size_t retaddr); +void HuMemMemoryFree(void *ptr, size_t retaddr); +void HuMemMemoryFreeNum(void *heap_ptr, u32 num, size_t retaddr); s32 HuMemUsedMemorySizeGet(void *heap_ptr); s32 HuMemUsedMemoryBlockGet(void *heap_ptr); s32 HuMemMemorySizeGet(void *ptr); s32 HuMemMemoryAllocSizeGet(s32 size); void HuMemHeapDump(void *heap_ptr, s16 status); -#endif \ No newline at end of file +#endif diff --git a/src/game/memory.c b/src/game/memory.c index 9a2cd504..77b0a569 100644 --- a/src/game/memory.c +++ b/src/game/memory.c @@ -13,10 +13,10 @@ struct memory_block { struct memory_block *prev; struct memory_block *next; u32 num; - u32 retaddr; + size_t retaddr; }; -static void *HuMemMemoryAlloc2(void *heap_ptr, s32 size, u32 num, u32 retaddr); +static void *HuMemMemoryAlloc2(void *heap_ptr, s32 size, u32 num, size_t retaddr); void *HuMemHeapInit(void *ptr, s32 size) {