aboutsummaryrefslogtreecommitdiffstats
path: root/dos/malloc.h
diff options
context:
space:
mode:
authorhpa <hpa>2004-12-18 22:56:01 +0000
committerhpa <hpa>2004-12-18 22:56:01 +0000
commitc854c3a8224da9dfa30d583edef6bc1b92b17aeb (patch)
treed67234518bef4e3a0d4b5913eaf124b9d3b3197f /dos/malloc.h
parent5e9b05475246cd32b5c6d4a79b3f1817b92b7bce (diff)
downloadsyslinux.git-c854c3a8224da9dfa30d583edef6bc1b92b17aeb.tar.gz
syslinux.git-c854c3a8224da9dfa30d583edef6bc1b92b17aeb.tar.xz
syslinux.git-c854c3a8224da9dfa30d583edef6bc1b92b17aeb.zip
Fix handling of alignment issues
Diffstat (limited to 'dos/malloc.h')
-rw-r--r--dos/malloc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/dos/malloc.h b/dos/malloc.h
index 57b76526..70d0e635 100644
--- a/dos/malloc.h
+++ b/dos/malloc.h
@@ -37,10 +37,10 @@ struct arena_header {
#define ARENA_TYPE_HEAD 2
#endif
-#define ARENA_SIZE_MASK (~(sizeof(struct arena_header)-1))
+#define ARENA_SIZE_MASK (sizeof(struct arena_header)-1)
-#define ARENA_ALIGN_UP(p) ((char *)(((uintptr_t)(p) + ARENA_SIZE_MASK) & ARENA_SIZE_MASK))
-#define ARENA_ALIGN_DOWN(p) ((char *)((uintptr_t)(p) & ARENA_SIZE_MASK))
+#define ARENA_ALIGN_UP(p) ((char *)(((uintptr_t)(p) + ARENA_SIZE_MASK) & ~ARENA_SIZE_MASK))
+#define ARENA_ALIGN_DOWN(p) ((char *)((uintptr_t)(p) & ~ARENA_SIZE_MASK))
/*
* This structure should be no more than twice the size of the