mm_heap: double malloced memory default alignment (4 -> 8, 8 -> 16)

Base on the gnu libc standard:
https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html

Change the default memory aligment to 8 bytes for 32-bit system and
16 bytes for 64-bit system.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
wangbowen6 2023-03-06 16:10:31 +08:00 committed by Alin Jerpelea
parent 70083168f1
commit 3e971d2e6d
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ config MM_KERNEL_HEAPSIZE
config MM_DFAULT_ALIGNMENT config MM_DFAULT_ALIGNMENT
int "Memory default alignment in bytes" int "Memory default alignment in bytes"
default 8 default 0
range 0 64 range 0 64
---help--- ---help---
The memory default alignment in bytes, if this value is 0, the real The memory default alignment in bytes, if this value is 0, the real

View File

@ -111,7 +111,7 @@
#define MM_NNODES (MM_MAX_SHIFT - MM_MIN_SHIFT + 1) #define MM_NNODES (MM_MAX_SHIFT - MM_MIN_SHIFT + 1)
#if CONFIG_MM_DFAULT_ALIGNMENT == 0 #if CONFIG_MM_DFAULT_ALIGNMENT == 0
# define MM_ALIGN sizeof(uintptr_t) # define MM_ALIGN (2 * sizeof(uintptr_t))
#else #else
# define MM_ALIGN CONFIG_MM_DFAULT_ALIGNMENT # define MM_ALIGN CONFIG_MM_DFAULT_ALIGNMENT
#endif #endif