summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbernard <[email protected]>2023-03-01 00:30:03 +0800
committerMan, Jianting (Meco) <[email protected]>2023-02-28 17:32:36 -0500
commit75c3261181d5fa12c0ceead8abc88429ef2b1ee6 (patch)
tree96e2d542ec3be092233ccf87b23bec18326ca16b /src
parent111a5b88cb2f9ecc87fb89df351c5045b620cb54 (diff)
[Kernel] Fix the alignment issue for memheap.
Diffstat (limited to 'src')
-rw-r--r--src/memheap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/memheap.c b/src/memheap.c
index 62142af34d..26d7ecfa3e 100644
--- a/src/memheap.c
+++ b/src/memheap.c
@@ -18,6 +18,7 @@
* 2013-07-11 Grissiom fix the memory block splitting issue.
* 2013-07-15 Grissiom optimize rt_memheap_realloc
* 2021-06-03 Flybreak Fix the crash problem after opening Oz optimization on ac6.
+ * 2023-03-01 Bernard Fix the alignment issue for minimal size
*/
#include <rthw.h>
@@ -32,7 +33,7 @@
#define RT_MEMHEAP_FREED 0x00
#define RT_MEMHEAP_IS_USED(i) ((i)->magic & RT_MEMHEAP_USED)
-#define RT_MEMHEAP_MINIALLOC 12
+#define RT_MEMHEAP_MINIALLOC RT_ALIGN(12, RT_ALIGN_SIZE)
#define RT_MEMHEAP_SIZE RT_ALIGN(sizeof(struct rt_memheap_item), RT_ALIGN_SIZE)
#define MEMITEM_SIZE(item) ((rt_ubase_t)item->next - (rt_ubase_t)item - RT_MEMHEAP_SIZE)