From 4c25fe684ac64fec240445ae179dc9fcbe01f1d4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 6 Oct 2014 12:49:35 -0600 Subject: Fix a place in the memory manager where it explicitly assumes that the size of a point is 4 bytes. That is OK if the actually size is smaller but makes the heap unstable when used withthe x86_64 host simulation --- nuttx/include/nuttx/mm/mm.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/nuttx/include/nuttx/mm/mm.h b/nuttx/include/nuttx/mm/mm.h index 05968f625..707d7f7da 100644 --- a/nuttx/include/nuttx/mm/mm.h +++ b/nuttx/include/nuttx/mm/mm.h @@ -204,15 +204,8 @@ struct mm_freenode_s /* What is the size of the freenode? */ -#ifdef CONFIG_MM_SMALL -# ifdef CONFIG_SMALL_MEMORY -# define SIZEOF_MM_FREENODE 8 -# else -# define SIZEOF_MM_FREENODE 12 -# endif -#else -# define SIZEOF_MM_FREENODE 16 -#endif +#define MM_PTR_SIZE sizeof(FAR struct mm_freenode_s *) +#define SIZEOF_MM_FREENODE (SIZEOF_MM_ALLOCNODE + 2*MM_PTR_SIZE) #define CHECK_FREENODE_SIZE \ DEBUGASSERT(sizeof(struct mm_freenode_s) == SIZEOF_MM_FREENODE) -- cgit v1.2.3