From ab4993fda2220770452c98f648a1283c502fe9b5 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 11 May 2007 19:42:50 +0000 Subject: [PATCH] Ooops, checked in the wrong version before :-( --- src/core/mem.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/mem.c b/src/core/mem.c index c03d1998..76540de5 100644 --- a/src/core/mem.c +++ b/src/core/mem.c @@ -60,13 +60,16 @@ struct mem { }; /* All allocated blocks will be MIN_SIZE bytes big, at least! */ -#define MIN_SIZE MEM_ALIGN_SIZE(12) +#ifndef MIN_SIZE +#define MIN_SIZE 12 +#endif /* MIN_SIZE */ +#define MIN_SIZE_ALIGNED MEM_ALIGN_SIZE(MIN_SIZE) #define SIZEOF_STRUCT_MEM MEM_ALIGN_SIZE(sizeof(struct mem)) #define MEM_SIZE_ALIGNED MEM_ALIGN_SIZE(MEM_SIZE) static struct mem *ram_end; /* the heap. we need one struct mem at the end and some room for alignment */ -static u8_t ram_heap[MEM_SIZE_ALIGNED + SIZEOF_STRUCT_MEM + MEM_ALIGNMENT]; +static u8_t ram_heap[MEM_SIZE_ALIGNED + (2*SIZEOF_STRUCT_MEM) + MEM_ALIGNMENT]; static u8_t *ram; /* for alignment, ram is now a pointer instead of an array */ static struct mem *lfree; /* pointer to the lowest free block */ static sys_sem_t mem_sem; /* concurrent access protection */