-
Notifications
You must be signed in to change notification settings - Fork 3k
Cellular: Refactor APN db implementation to reduce memory usage #10821
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
Conversation
|
@kivaisan, thank you for your changes. |
| /** | ||
| * Default APN settings used by many networks | ||
| */ | ||
| static const char *apndef = _APN("internet",,); |
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.
Can save a little more here by making that a char[] array like apnlut. It's currently a RAM pointer to a ROM char array.
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.
Do you mean static const char apndef[] = _APN("internet",,); ? At least with GCC this does not change anything.
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.
Yes.
I guess that as apndef is a file-scope variable, the compiler manages to figure out that no-one ever writes to it, so it can optimise it out, and treat it as a constant, even though it's not declared as such.
I'd still prefer to say what we actually need, rather than rely on the compiler being bright. If you don't need a pointer, don't declare one. Assuming non-automatic storage,
const char xx[] = "foo"; // 4 bytes of string in ROM
is better than
const char * const xx = "foo"; // 4 bytes of string in ROM, and a 4-byte pointer to it in ROM
is better than
const char *xx = "foo"; // 4 bytes of string in ROM, 4 bytes of pointer initialisation in ROM, 4 bytes of pointer in RAM
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.
Fixed
|
This impact report was requested by @TommiTallgren - get yours at https://softagram.com/pull-request-bot Softagram Impact Report for pull/10821 (head commit: 841173e)Target: K64F⭐ Change Overview
📄 Full report
Give feedback on this report to [email protected] |
This report is added here just for the reference by our bot. There are 2 more and they are bacground information for the discussion with ARM to activate it for serving the community. Happy to hear your thoughts, more on how to read the report on here: http://help.softagram.com/articles/2847546-pull-merge-request-report-explained |
Reduce memory usage by moving actual APN database into single object file instead of having it defined in header as a static.
|
ci started |
Test run: FAILEDSummary: 2 of 7 test jobs failed Failed test jobs:
|
|
Internal server error, will restart once RC4 is in |
|
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |

Description
Reduce memory usage by moving actual APN database into single object file
instead of having it defined in header as a static.
Also implementation is enabled only if either
cellular.use-apn-lookup or ppp-cell-iface.apn-lookup is enabled.
Pull request type
Reviewers
@jarvte @AnttiKauppila @mudassar-ublox
Release Notes