-
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
Static / dynamic allocator #9922
Conversation
Allocator that can be set up at compile time to either allocate from a static pool, or to use dynamic allocation.
We already have more than one pool implementation in our current system, #9748 is the last PR to converge them. The final gaol is we only have one pool implementation in CHIP SDK so the developers don't have to make decision which one to choose. I found different pool implementations provide similar APIs, if there is some features not available on the current pool implementation, I would prefer enhance on top of it instead of creating a new one. |
That sounds great - would you mind if I went in and made changes to the system pool to support an unsized base and an iterator? What are your feelings on the per-pool selection of static / dynamic? (templating change with 0 pool size for dynamic) |
Please go ahead, we need to add the improvement on SystemPool for the feature we needed |
I very much like the iterator pattern. I think that should replace the existing There is the question of locking which exists in the |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This stale pull request has been automatically closed. Thank you for your contributions. |
Problem
This is just a draft - wanted to get some feedback.
We have the System the SystemObjectPool to do pool based allocations now, but I was also working on a similar pool allocator for the mdns stuff and I wanted to get some feedback on incorporating this style of pool into the SystemObjectPool and whether that would mess anything up for you.
Desirable properties of the GenericAllocator
Drawbacks
So Question - would you be open to the idea of incorporating some of this functionality into the SystemObjectPool, such that we could have a SystemObjectPoolBase, an iterator accessor and per-pool heap/static configurability?
Change overview
Adds an Example for a static/dynamic allocator with tests, and shows how the allocator / iterator and base pointer would be use in the mdns layer.
Testing