Skip to content

Commit

Permalink
Separate ObjectPool into static and dynamic parts (#11371)
Browse files Browse the repository at this point in the history
* Separate ObjectPool into static and dynamic parts

The general goal of this refactor is to separate the static and
dynamic parts of the ObjectPool so that developers that support
heap allocation can also opt to use static allocation for portions
of their code. This refactor maps ObjectPool to the same default
types as current (dynamic if heap allocation is allowed, static
otherwise).

Upcoming refactor PRs:
- adding unlocked iterator access so we can use range-based for
  loops (works more easily with the design of certain part of the
  SDK stack)
- Demonstrating the use of the unsized abstract base type pointer
  for passing pools of unknown size

* Apply suggestions from code review

Co-authored-by: Michael Sandstedt <[email protected]>

* Fix size_t and remove base class.

Previous size_t changes broke the build - just using size_t now
for all stats.

Also remove the base class. The idea with that was to allow this
pool to be used with the unsigned base classes in the mdns code.
However, it looks like it's causing memory bloat despite the fact
that nothing actually uses that base class. So it looks like
maybe we just need to refactor to mdns.

Co-authored-by: Michael Sandstedt <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Nov 17, 2021
1 parent 20beec7 commit 5b2a4d8
Showing 1 changed file with 199 additions and 168 deletions.
Loading

0 comments on commit 5b2a4d8

Please sign in to comment.