Share print<N> body across buffer sizes via a span-based impl - #106
Merged
Conversation
write() no longer wraps its own coroutine; it just returns the future from the call it forwards to, since it owns no local state that needs to survive the call. print<buffer_size, ...>() now owns its buffer and delegates to a non-exported print(span, ...) so that different buffer_size instantiations of the same parameter pack share one function body instead of each generating a full copy. Also drops a stray `override` on four test mock destructors (can/i2c/serial/spi) whose base class destructors are protected and non-virtual by design; masked previously by incremental build caching, surfaced by a clean conan create build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
write()no longer wraps its own coroutine; it returns the future from the call it forwards to directly, since it owns no local state that needs to survive the call.print<buffer_size, Parameters...>()now owns its buffer and delegates to a non-exported span-basedprint(), so differentbuffer_sizeinstantiations of the sameParameterspack share one function body instead of each generating a full copy — a real, measured reduction in embedded flash usage.overrideon four test mock destructors (can/i2c/serial/spi) whose base class destructors are protected and non-virtual by design. This was masked by incremental build caching in local builds and only surfaced under a cleanconan createbuild.Test plan
conan build . -pr:a hal/tc/llvm --build=missing— all 15 test suites passconan create . -pr:a hal/tc/llvm --version=6.0.0 --build=missing— host package builds and test_package runsconan create . -pr:a hal/tc/llvm -pr hal/mcu/stm32f103zg --version=6.0.0 --build=missing— cross-compiled package builds