فهرست منبع

merge fix from blackfin cvs:
bernds writes: Use __alignof__ instead of sizeof to get alignments. Eliminates some warnings about misalignments when malloc debugging is enabled.

Mike Frysinger 20 سال پیش
والد
کامیت
82911dd000
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      libc/stdlib/malloc/heap.h
  2. 1 1
      libc/stdlib/malloc/malloc.h

+ 1 - 1
libc/stdlib/malloc/heap.h

@@ -25,7 +25,7 @@
    HEAP_GRANULARITY must be a power of 2.  Malloc depends on this being the
    HEAP_GRANULARITY must be a power of 2.  Malloc depends on this being the
    same as MALLOC_ALIGNMENT.  */
    same as MALLOC_ALIGNMENT.  */
 #define HEAP_GRANULARITY_TYPE	double
 #define HEAP_GRANULARITY_TYPE	double
-#define HEAP_GRANULARITY	(sizeof (HEAP_GRANULARITY_TYPE))
+#define HEAP_GRANULARITY	(__alignof__ (HEAP_GRANULARITY_TYPE))
 
 
 
 
 /* A heap is a collection of memory blocks, from which smaller blocks
 /* A heap is a collection of memory blocks, from which smaller blocks

+ 1 - 1
libc/stdlib/malloc/malloc.h

@@ -12,7 +12,7 @@
  */
  */
 
 
 /* The alignment we guarantee for malloc return values.  */
 /* The alignment we guarantee for malloc return values.  */
-#define MALLOC_ALIGNMENT	(sizeof (double))
+#define MALLOC_ALIGNMENT	(__alignof__ (double))
 
 
 /* The system pagesize... */
 /* The system pagesize... */
 extern size_t __pagesize;
 extern size_t __pagesize;