summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorMiles Bader <miles@lsi.nec.co.jp>2003-09-22 04:01:11 +0000
committerMiles Bader <miles@lsi.nec.co.jp>2003-09-22 04:01:11 +0000
commit84c79075fa2465e9d46ccae12f16e523c5c24e4b (patch)
treea97e33e1ff9a4e571f6aec082f8b797cc2da8a4c /libc
parent0511dd661021fca2d64438d6a02f3b9bba7f93c9 (diff)
More fiddling with static free-areas: make sure both their size _and_
their alignment are correct.
Diffstat (limited to 'libc')
-rw-r--r--libc/stdlib/malloc/heap.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libc/stdlib/malloc/heap.h b/libc/stdlib/malloc/heap.h
index 29a32c0bb..3dab65396 100644
--- a/libc/stdlib/malloc/heap.h
+++ b/libc/stdlib/malloc/heap.h
@@ -78,12 +78,12 @@ struct heap_free_area
#define HEAP_DECLARE_STATIC_FREE_AREA(name, size) \
static struct \
{ \
- HEAP_GRANULARITY_TYPE space[((size) \
- - sizeof (struct heap_free_area) \
- + (HEAP_GRANULARITY - 1)) \
- / HEAP_GRANULARITY]; \
+ HEAP_GRANULARITY_TYPE aligned_space; \
+ char space[HEAP_ADJUST_SIZE(size) \
+ - sizeof (struct heap_free_area) \
+ - HEAP_GRANULARITY]; \
struct heap_free_area _fa; \
- } name = { { (HEAP_GRANULARITY_TYPE)0 }, { (size), 0, 0 } }
+ } name = { (HEAP_GRANULARITY_TYPE)0, "", { HEAP_ADJUST_SIZE(size), 0, 0 } }
/* Rounds SZ up to be a multiple of HEAP_GRANULARITY. */