From c013862b693e5a77d444df6e450bb892881b88c2 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 3 Jan 2016 19:03:30 -0800 Subject: [PATCH] make mem alloc functions more consistent --- c/src/malloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c/src/malloc.c b/c/src/malloc.c index 0333edd97..30da5d632 100644 --- a/c/src/malloc.c +++ b/c/src/malloc.c @@ -41,8 +41,9 @@ void PutFirstMemBlockHeader(void *block, u32 size) PutMemBlockHeader(block, (struct MemBlock *)block, (struct MemBlock *)block, size - 16); } -void *AllocInternal(struct MemBlock *pos, u32 size) +void *AllocInternal(void *heapStart, u32 size) { + struct MemBlock *pos = (struct MemBlock *)heapStart; struct MemBlock *head = pos; struct MemBlock *splitBlock; u32 foundBlockSize; @@ -128,7 +129,7 @@ void FreeInternal(void *heapStart, void *pointer) void *AllocZeroedInternal(void *heapStart, u32 size) { - void *mem = AllocInternal((struct MemBlock *)heapStart, size); + void *mem = AllocInternal(heapStart, size); if (mem != NULL) { u32 zero;