commit | f43b6269d0e03daae4eaf216e7aa529a12327304 | [log] [tgz] |
---|---|---|
author | Taylor Cramer <cramertj@google.com> | Tue Dec 19 04:54:18 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Dec 19 04:54:18 2023 +0000 |
tree | e3239fc69f339e95279c9ac0eb2c5907f1f74011 | |
parent | 967f7bfce43b7f23e2b97b81a197bf427e7b3c1d [diff] |
pw_containers: Remove DestructorHelper from queues DestructorHelper was unsound: it would invoke `clear()` upon destruction of the base class after the child class containing the container storage had already been destroyed. This CL instead introduces an intermediate storage class specialized on trivially_destructible which implements the element-wise destruction. Additionally, this CL overrides `delete` privately in order to prevent calling `delete` on a polymorphic-sized container. Previously, calling `delete` in this way would result in undefined behavior due to the fact that the base class destructor was non-virtual. Bug: b/301329862 Change-Id: If7b8282f8c285fbe3951e67e3aad94fc48117f06 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/185030 Commit-Queue: Taylor Cramer <cramertj@google.com> Reviewed-by: 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/.