diff options
| author | Hanyuan Zhao <[email protected]> | 2024-03-05 15:37:35 +0800 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-03-13 12:40:43 -0400 |
| commit | 421359ac52bfc80946929c4ffeacf6a68273e758 (patch) | |
| tree | 7107a561bfccef84411b2d04500ae457d03d27f0 /cmd | |
| parent | 44951340309d0dca73c05fc61406a1e839d1da93 (diff) | |
cli: allow users to determine history buffer allocation method
This commit allows users to choose the appropriate memory
allocation method between static allocated and dynamically
calloc. The previous static-array way will not obviously
contribute to the final binary size since it is uninitialized,
and might have better performance than the dynamical one.
Now we provide the users with both the two options.
Signed-off-by: Hanyuan Zhao <[email protected]>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/Kconfig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index 102f62ac89d..bd5464a4989 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -189,6 +189,17 @@ config CMD_HISTORY Show the command-line history, i.e. a list of commands that are in the history buffer. +config CMD_HISTORY_USE_CALLOC + bool "dynamically allocate memory" + default y + depends on CMD_HISTORY + help + Saying Y to this will use calloc to get the space for history + storing. Otherwise the history buffer will be an uninitialized + static array directly, without the memory allocation, and it is + writable after relocation to RAM. If u-boot is running from ROM + all the time or unsure, say Y to this. + config CMD_LICENSE bool "license" select BUILD_BIN2C |
