-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add a ObjectPoolIterator::Type
class to allow begin/end iteration on active objects in memory pools.
#32126
Merged
Conversation
This file contains 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
…ng looping ... ouch!
pullapprove
bot
requested review from
andyg-apple,
anush-apple,
arkq,
bzbarsky-apple,
carol-apple,
cecille and
chrisdecenzo
February 14, 2024 19:31
PR #32126: Size comparison from 7113c98 to 86b15dc Increases (4 builds for mbed, qpg, stm32)
Decreases (2 builds for cc32xx)
Full report (6 builds for cc32xx, mbed, qpg, stm32)
|
PR #32126: Size comparison from 7113c98 to ad23745 Increases (57 builds for bl702, bl702l, cc13x4_26x4, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, qpg, stm32, telink)
Decreases (31 builds for bl602, bl702, bl702l, cc32xx, efr32, esp32, linux, nrfconnect, psoc6)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
PR #32126: Size comparison from 274719d to 884f7fb Increases (14 builds for linux)
Decreases (3 builds for efr32, linux)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
bzbarsky-apple
requested changes
Feb 22, 2024
PR #32126: Size comparison from fc61ca0 to 7de5ad0 Increases (14 builds for linux)
Decreases (4 builds for efr32, linux)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
bzbarsky-apple
approved these changes
Feb 23, 2024
PR #32126: Size comparison from 10ff1f6 to 2400a76 Increases (14 builds for linux)
Decreases (5 builds for efr32, linux)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
tcarmelveilleux
approved these changes
Feb 26, 2024
PR #32126: Size comparison from 9c6cf9a to 1b477aa Increases (14 builds for linux)
Decreases (5 builds for efr32, linux)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, stm32, telink)
|
huangxuyong
pushed a commit
to huangxuyong/connectedhomeip
that referenced
this pull request
Mar 19, 2024
…n active objects in memory pools. (project-chip#32126) * Remove PoolCommon: bad name, non-member method, very very limited usage * Restyle * Have a working iterator (and unit test) for static bitmap iterator * Start unit testing for nested loops * Fix tests and implementation * Added another test * Extra unit test that we iterate correctly * Added comment about returning null on failure * Fix compile on fixed size pools * Restyle * Support iteration depth since it seems we need to delete objects during looping ... ouch! * Update to also have a post-iteration clean when using iterators * Make sure iterators on pools have a type that can be passed around * Switch to not use a cast * Fix types ... use auto because types are messy, unsure why * Rename for smaller diff * Rename for smaller diff * Correct the comment * More comments cleanup * Remove useless comment * make things compile for NRF * Restyle * Update the comment * Update allocated to active in naming * Add comment regarding iteration depth * Undo submodule update --------- Co-authored-by: Andrei Litvin <[email protected]>
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.
Looking to have a way to iterate over active memory objects in memory pools. The usage of
ForEachActiveObject
callback is awkward (lambdas with captures) and encourages coupling as underlying objects have now way to return "items to process" from within delegates and similar items.This adds support for iteration such as
for (auto value : pool)
andfor (auto it = pool.begin(); it != pool.end(); it++)
The intent is to eventually support decoupling things that are strongly dependent on friend classes and pool sizes (like things accessing read and write handlers within InteractionModelEngine).
Example: