commit | c4cf469a53bed014cbe797a93aec971536e68f86 | [log] [tgz] |
---|---|---|
author | Aaron Green <aarongreen@google.com> | Wed May 22 13:43:21 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed May 22 13:43:21 2024 +0000 |
tree | 89903df63177daf30b5dab1e516f368b01a6de42 | |
parent | 5e6b6c962de2402400cffa9d0f370efe5f82dc68 [diff] |
pw_allocator: Reduce Block fragmentation This CL modifies how leading padding is handled when allocating aligned blocks. Previously, if padding was needed a block was always allocated, and the padding had to be at least the minimum block size. Now, if the padding needed is smaller than the minimum block size, the padding is instead appended to the previous block. This reduces fragmentation and leads to better space utilization. As part of this CL, the Block::*Alloc* methods have also been cleaned up according to a recent suggestions, e.g. simpilified to use Layouts. Bug: 328831791 Change-Id: Ie8e0d527243b0a306bb1597715d5c69a93d79019 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/209538 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Reviewed-by: Taylor Cramer <cramertj@google.com> Reviewed-by: Keir Mierle <keir@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/.