-
Notifications
You must be signed in to change notification settings - Fork 574
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
testing/sd_*: Restrict function and variable scope to current file. #2201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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 |
Add the static keyword to required function and variable delcaration to reduce their scope. Stops namespace pollution in CONFIG_BUILD_FLAT.
Add the static keyword to required function and variable delcaration to reduce their scope. Stops namespace pollution in CONFIG_BUILD_FLAT.
Sorry, I'd forgotten that this was pending. These variables are marked static, so if I understand correctly, there scope is limited to the files the file they are declared in. There is an opportunity to reduce the scope of some of these variables, if required I can refactor. |
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
andCONFIG_TESTING_SD_STRESS
are enables simultaneously.Testing
Enable
CONFIG_TESTING_SD_BENCH
andCONFIG_TESTING_SD_STRESS
at the same time.