Skip to content
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

FHSS timer: Use singleton pointer #9579

Merged
merged 1 commit into from Feb 5, 2019

Conversation

Projects
None yet
7 participants
@JarkkoPaso
Copy link
Contributor

JarkkoPaso commented Feb 1, 2019

Description

Use singleton pointer with FHSS timer.

Pull request type

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

Reviewers

@JarkkoPaso

This comment has been minimized.

Copy link
Contributor Author

JarkkoPaso commented Feb 1, 2019

@kjbracey-arm Can I use singletonptr from array. Seems to work ok with array size of 2.

@kjbracey-arm

This comment has been minimized.

Copy link
Contributor

kjbracey-arm commented Feb 1, 2019

Yes, it's fine to enclose a SingletonPtr as a member of any other static object.

That would only be useful if that static object then becomes a simple object - ie it has no explicit constructor, and its default constructor now has nothing to do because none of its members have explicit constructors - all its complex C++ members are SingletonPtr-wrapped.

@cmonr cmonr added the needs: review label Feb 1, 2019

@cmonr

This comment has been minimized.

Copy link
Contributor

cmonr commented Feb 1, 2019

I'm curious. Why was this change needed? All I'm able to find is that a change was made, not why.

@cmonr

This comment has been minimized.

Copy link
Contributor

cmonr commented Feb 2, 2019

CI started

@cmonr cmonr added needs: CI and removed needs: review labels Feb 2, 2019

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Feb 2, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Feb 4, 2019

I'm curious. Why was this change needed? All I'm able to find is that a change was made, not why.

can you add this to the commit msg ? what is this addressing.

@0xc0170 0xc0170 added needs: work and removed needs: CI labels Feb 4, 2019

@JarkkoPaso

This comment has been minimized.

Copy link
Contributor Author

JarkkoPaso commented Feb 4, 2019

@kjbracey-arm Can you educate us regarding singletonptr?

@kjbracey-arm

This comment has been minimized.

Copy link
Contributor

kjbracey-arm commented Feb 4, 2019

It prevents the static objects always being included in a build. Without the SingletonPtr, blinky would still put those Timer objects in the image to run their constructor, with increased RAM and ROM usage.

If you have any top-level static C++ objects with constructors, wrapping them in SingletonPtr ensures that they are only included in the build if actually used - the constructor is run on first reference, not before main. And if never referenced, it's never constructed, and excluded by the linker altogether.

Tests should have flagged a blinky size increase when those objects were first added.

FHSS timer: Use singleton pointer with timer objects
This is to save statically allocated memory. Without SingletonPtr the timer objects would always be included in build.

@JarkkoPaso JarkkoPaso force-pushed the JarkkoPaso:timer_fhss_singleton branch to 17e4e28 Feb 4, 2019

@JarkkoPaso

This comment has been minimized.

Copy link
Contributor Author

JarkkoPaso commented Feb 4, 2019

Thanks Kevin! I updated the commit message.

@0xc0170

0xc0170 approved these changes Feb 4, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Feb 4, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Feb 4, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test
@alekla01

This comment has been minimized.

Copy link
Contributor

alekla01 commented Feb 4, 2019

restarted jenkins-ci/greentea-test

@0xc0170 0xc0170 merged commit 95906f1 into ARMmbed:master Feb 5, 2019

27 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-ARMC6 Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(-848 bytes) RAM(-192 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Local astyle testing has passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/doxy-spellcheck Local doxy-spellcheck testing has passed
Details
travis-ci/events Passed, runtime is 10085 cycles (+770 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/include_check Local include_check testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8408B (+0.00%)
Details
travis-ci/psa-autogen Local psa-autogen testing has passed
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
travis-ci/tools-py3.5 Local tools-py3.5 testing has passed
Details
travis-ci/tools-py3.6 Local tools-py3.6 testing has passed
Details
travis-ci/tools-py3.7 Local tools-py3.7 testing has passed
Details

@0xc0170 0xc0170 removed the ready for merge label Feb 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.