-
Notifications
You must be signed in to change notification settings - Fork 32
Don't require platform.callback-nontrivial #116
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
Replacement for #115. Only merge one of the PRs. |
@kjbracey-arm Just to confirm - travis failures are expected as Mbed OS PR not yet integrated. So the proposal steps will be to merge this one, merge Mbed OS PR (it will test this example so if passes we are all ok). |
Actually, both this and #115 should be passing with current master, they don't depend on the PR. But they're prerequisites to the PR passing. |
Hmm, error indicates the CI here is not being built as C++11. Eh? Really old Mbed OS?
|
yes, master points to very old sha: https://github.com/ARMmbed/mbed-os-example-filesystem/blob/master/mbed-os.lib , update in this PR to resolve it |
To master or a 6.0-beta, or 5.15? |
Don't use an `Event` with `Callback` - it's non-trivial, so needs the "full" form of `Callback`. `Callback` is being switched to not support non-trivial functors by default to save ROM. Use a `reference_wrapper` to a `UserAllocatedEvent` instead, which works fine with the trivial-only `Callback`. A `reference_wrapper` is small enough to fit in a `Callback`, and is trivially-copyable, so works to decouple the event lifetime from the callback. Having decoupled it, the event has program lifetime, so may as well be `UserAllocatedEvent` for simplicity. (`UserAllocatedEvent` could be trivial, but is too big to be placed in a `Callback` directly in any case).
Updated to Mbed OS 5.15.2 |
Don't use an
Event
withCallback
- it's non-trivial, so needs the "full" form ofCallback
.Callback
is being switched to not support non-trivial functors by default to save ROM.Use a
reference_wrapper
to aUserAllocatedEvent
instead, which works fine with the trivial-onlyCallback
.A
reference_wrapper
is small enough to fit in aCallback
, and is trivially-copyable, so works to decouple the event lifetime from the callback. Having decoupled it, the event has program lifetime, so may as well beUserAllocatedEvent
for simplicity.(
UserAllocatedEvent
could be trivial, but is too big to be placed in aCallback
directly in any case).