-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apps/nshlib: Using lib_get_tempbuffer()
to save stack space
#65
apps/nshlib: Using lib_get_tempbuffer()
to save stack space
#65
Conversation
Applications should not depend on any properties of nshlib Signed-off-by: chao an <[email protected]>
LINE_MAX: apache/nuttx#15344 Signed-off-by: wangjianyu3 <[email protected]>
Comparison Config: "esp32s3-devkit:adb" with `CONFIG_LINE_MAX=512` Test CMD: `ls | cat | cat | cat` Without this patch | | Before Test CMD | After Test CMD | |---------------:|----------------:|----------------:| | nsh_main.STACK | 0002624/0008096 | 0002624/0008096 | | sh.STACK | 0003360/0004008 | 0003360/0004008 | | Free/Total | 355288/403116 | 355288/403116 | With this patch | | Before Test CMD | After Test CMD | |---------------:|----------------:|----------------:| | nsh_main.STACK | 0001616/0008096 | 0001616/0008096 | | sh.STACK | 0002352/0004008 | 0002352/0004008 | | Free/Total | 355288/403116 | 354760/403116 | Signed-off-by: wangjianyu3 <[email protected]>
…ails Signed-off-by: wangjianyu3 <[email protected]>
@anchao Could you take a look about the CLA please ;-) |
Coverity Log CID 1612743: (open-vela#1 of 1): Resource leak (RESOURCE_LEAK) 12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle. Signed-off-by: wangjianyu3 <[email protected]>
Done |
Summary
Using
lib_get_tempbuffer()
to save stack spacelib_get_tempbuffer()
to save stack spaceCONFIG_NSH_LINELEN
toLINE_MAX
CONFIG_NSH_LINELEN
toLINE_MAX
(Picked from apps/system: replace CONFIG_NSH_LINELEN to LINE_MAX apache/nuttx-apps#2918 by @anchao )Impact
Testing
Config: "esp32s3-devkit:adb" with
CONFIG_LINE_MAX=512
Test CMD:
ls | cat | cat | cat
Without this patch
With this patch