Merge pull request #606 from Mortano/union-repr

Fix memory layout of UnionNode<T> in pool module
This commit is contained in:
Zeeshan Ali Khan 2025-09-08 13:54:41 +00:00 committed by GitHub
commit ceb3fc06ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- CI now uses flags specified in `Cargo.toml` for `rustdoc` tests.
- Fixed clippy lints.
- Fixed the memory layout of the internal `UnionNode<T>` type, fixing possible Undefined Behaviour.
### Removed

View File

@ -44,6 +44,7 @@ pub trait Node: Sized {
fn next_mut(&mut self) -> &mut AtomicPtr<Self>;
}
#[repr(C)]
pub union UnionNode<T> {
next: ManuallyDrop<AtomicPtr<UnionNode<T>>>,
pub data: ManuallyDrop<T>,