nuttx-apps
nuttx-apps copied to clipboard
testing/sd_*: Restrict function and variable scope to current file.
Summary
Add the static keyword to required function and variable delcaration to reduce their scope. Stops namespace pollution in CONFIG_BUILD_FLAT
Impact
Stops symbol collision when CONFIG_TESTING_SD_BENCH
and CONFIG_TESTING_SD_STRESS
are enables simultaneously.
Testing
Enable CONFIG_TESTING_SD_BENCH
and CONFIG_TESTING_SD_STRESS
at the same time.
Why not allocate these in a struct and reduce memory footprint that just including that app costs?
Could you please expand more with maybe a kind of example. I'm not fully following your proposal. I think all those local static const
s will be optimized out by compiler anyway.
Why not allocate these in a struct and reduce memory footprint that just including that app costs?
Could you please expand more with maybe a kind of example. I'm not fully following your proposal. I think all those local
static const
s will be optimized out by compiler anyway.
I did not think these were local. Also as globals they do not conform to the coding standard.
My point was placing all the variables in a struct allocated at run time will reduce the data size to a single pointer or 0 if it is passed as an argument.
ping @g2gps