Skip to content

Conversation

@kivaisan
Copy link
Contributor

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

[ ] Fix
[X] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@jarvte @AnttiKauppila @mudassar-ublox

Release Notes

@ciarmcom ciarmcom requested review from a team, AnttiKauppila and jarvte June 13, 2019 11:00
@ciarmcom
Copy link
Member

@kivaisan, thank you for your changes.
@AnttiKauppila @jarvte @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

/**
* Default APN settings used by many networks
*/
static const char *apndef = _APN("internet",,);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@softagram-bot
Copy link

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

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

📄 Full report

Give feedback on this report to [email protected]

@TommiTallgren
Copy link

This impact report was requested by @TommiTallgren - get yours at https://softagram.com/pull-request-bot
...

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.
@adbridge
Copy link
Contributor

ci started

@mbed-ci
Copy link

mbed-ci commented Jun 21, 2019

Test run: FAILED

Summary: 2 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 24, 2019

Internal server error, will restart once RC4 is in

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 24, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Jun 25, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit 63d1ea3 into ARMmbed:master Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants