forked from google/pigweed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_containers: Intrusive list item auto-removal
Previously, it was easy to accidentally have dangling use-after-free errors with intrusive list items. This patch changes the logic so that items remove themselves from their parent list during destruction. Additionally, this changes IntrusiveList<T>::Item's semantics so that instead of a nullptr to indicating an unlisted element, a self-cycle indicates unlisted. This leads to more elegant logic. Change-Id: I5de663f7c67112b4b9465373d64c0d57b05bd892 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16260 Reviewed-by: Armando Montanez <[email protected]> Commit-Queue: Keir Mierle <[email protected]>
- Loading branch information
Showing
4 changed files
with
171 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.