commit | 6d332ab9dbf286aa8689b03ddd327822b5be6b65 | [log] [tgz] |
---|---|---|
author | Aaron Green <aarongreen@google.com> | Fri Apr 12 19:41:49 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Apr 12 19:41:49 2024 +0000 |
tree | 5720144ea5f05271370ceab1ecb0744b9bd3db19 | |
parent | c47f14d48c690fdb264ff6114d5496af38620542 [diff] |
pw_allocator: Add Pool This CL adds a slab allocator called `TypedPool`, which can allocate a specific object type with very low overhead. To achieve this, it first introduces a new interface, `Pool`, which differs from `Allocator` in that it only provides memory of a fixed layout. Common behaviors between `Pool` and `Allocator` have been promoted to a new base class, `Deallocator`. With these types in place, the slab allocator simply wraps a pool of fixed size chunks to provide fast and convenient object creation. Change-Id: I0d1bf777a6f2e3b3fc9ac59a826196cc5ccd5adb Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/195540 Reviewed-by: Taylor Cramer <cramertj@google.com> Commit-Queue: Aaron Green <aarongreen@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.