|
@@ -29,8 +29,10 @@
|
|
/* The heap allocates in multiples of, and aligned to, HEAP_GRANULARITY.
|
|
/* The heap allocates in multiples of, and aligned to, HEAP_GRANULARITY.
|
|
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 __attribute_aligned__ (sizeof (size_t))
|
|
+#define HEAP_GRANULARITY_TYPE double __attribute_aligned__ (HEAP_GRANULARITY)
|
|
-#define HEAP_GRANULARITY (__alignof__ (HEAP_GRANULARITY_TYPE))
|
|
+#define HEAP_GRANULARITY \
|
|
|
|
+ (__alignof__ (double) > sizeof (size_t) ? __alignof__ (double) : sizeof (size_t))
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/* The HEAP_INIT macro can be used as a static initializer for a heap
|
|
/* The HEAP_INIT macro can be used as a static initializer for a heap
|