Skip to content

ARM toolchain: heap setup micro-optimisation #11701

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

Merged
merged 1 commit into from
Oct 18, 2019

Conversation

kjbracey
Copy link
Contributor

Description

Locating and checking the length of the ARM_LIB_HEAP region is an extra task, when we're just interested in the base and limit. Looking at only those saves 8 bytes of ROM.

More space could be saved if we ensured all targets had ARM_LIB_HEAP, removing the need for this run-time fallback code.

Pull request type

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

Locating and checking the length of the `ARM_LIB_HEAP` region is an
extra task, when we're just interested in the base and limit. Looking at
only those saves 8 bytes of ROM.

More space could be saved if we ensured all targets had `ARM_LIB_HEAP`,
removing the need for this run-time fallback code.
@kjbracey
Copy link
Contributor Author

Having just done this, my "C standard paranoia" kicks in. According to the standard, all objects have distinct addresses, so the compiler would be within its rights to eliminate the test, and assume that the condition is true. Hmm.

@kjbracey
Copy link
Contributor Author

But then again, in the original version, all objects have non-null addresses, so the compiler could have optimised that out too.

@kjbracey
Copy link
Contributor Author

kjbracey commented Oct 17, 2019

Ah, the WEAK attribute of course opens the door to any of them being null, so that effectively forces the compiler to deactivate any such optimisation normally applied to C objects. All good.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 17, 2019

CI started

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 17, 2019

Tests will fail (iar license issue, investigating)

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 17, 2019

Restarted failed jobs

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2019

Test run: FAILED

Summary: 3 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-IAR
  • jenkins-ci/mbed-os-ci_cloud-client-test
  • jenkins-ci/mbed-os-ci_exporter

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 18, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Oct 18, 2019

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

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

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 18, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Oct 18, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 added ready for merge release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 and removed needs: CI labels Oct 18, 2019
@0xc0170 0xc0170 merged commit 00fc308 into ARMmbed:master Oct 18, 2019
@kjbracey kjbracey deleted the heapsave8 branch October 21, 2019 06:42
@0xc0170 0xc0170 added release-version: 5.15.0-rc1 and removed release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 labels Nov 19, 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.

3 participants