From 16a187203593607bc9d6338adfca8a48b5cc3086 Mon Sep 17 00:00:00 2001 From: "zik.saleeba" Date: Sun, 13 Jun 2010 11:31:19 +0000 Subject: [PATCH] Now allocating heap using malloc() on UNIX git-svn-id: http://picoc.googlecode.com/svn/trunk@431 21eae674-98b7-11dd-bd71-f92a316d2d60 --- heap.c | 2 +- platform.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/heap.c b/heap.c index e23b072..606b216 100644 --- a/heap.c +++ b/heap.c @@ -216,7 +216,7 @@ void *HeapAllocMem(int Size) void HeapFreeMem(void *Mem) { #ifdef USE_MALLOC_HEAP - return free(Mem); + free(Mem); #else struct AllocNode *MemNode = (struct AllocNode *)((char *)Mem - MEM_ALIGN(sizeof(MemNode->Size))); int Bucket = MemNode->Size >> 2; diff --git a/platform.h b/platform.h index 24febff..acecef8 100644 --- a/platform.h +++ b/platform.h @@ -38,7 +38,8 @@ /* host platform includes */ #ifdef UNIX_HOST -# define HEAP_SIZE (128*1024) /* space for the heap and the stack */ +# define HEAP_SIZE (128*1024) /* space for the the stack */ +# define USE_MALLOC_HEAP /* heap is allocated using malloc() */ # include # include # include