[uClibc-cvs] uClibc/libc/stdlib/malloc heap.h,1.13,1.14

Miles Bader miles at uclibc.org
Fri Sep 19 10:10:37 UTC 2003


Update of /var/cvs/uClibc/libc/stdlib/malloc
In directory winder:/tmp/cvs-serv8563

Modified Files:
	heap.h 
Log Message:
Make sure we don't allocate too little space for static free-areas
because of our fiddling with alignment (because doing so is VERY BAD).


Index: heap.h
===================================================================
RCS file: /var/cvs/uClibc/libc/stdlib/malloc/heap.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- heap.h	17 Sep 2003 11:50:18 -0000	1.13
+++ heap.h	19 Sep 2003 10:10:33 -0000	1.14
@@ -78,7 +78,9 @@
 #define HEAP_DECLARE_STATIC_FREE_AREA(name, size)			      \
   static struct								      \
   {									      \
-    HEAP_GRANULARITY_TYPE space[((size) - sizeof (struct heap_free_area))     \
+    HEAP_GRANULARITY_TYPE space[((size)					      \
+				 - sizeof (struct heap_free_area)	      \
+				 + (HEAP_GRANULARITY - 1))		      \
 				/ HEAP_GRANULARITY];			      \
     struct heap_free_area _fa;						      \
   } name = { { (HEAP_GRANULARITY_TYPE)0 }, { (size), 0, 0 } }




More information about the uClibc-cvs mailing list