From 1273be4cfca2b3f55b4d739cad4336725c57b0b2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 6 Oct 2014 12:49:35 -0600 Subject: [PATCH] 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 --- include/nuttx/mm/mm.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/nuttx/mm/mm.h b/include/nuttx/mm/mm.h index 05968f6258..707d7f7daa 100644 --- a/include/nuttx/mm/mm.h +++ b/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)