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:
parent
70083168f1
commit
3e971d2e6d
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue