mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-30 22:10:37 +00:00
Merge pull request #606 from Mortano/union-repr
Fix memory layout of UnionNode<T> in pool module
This commit is contained in:
commit
ceb3fc06ba
@ -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.
|
- CI now uses flags specified in `Cargo.toml` for `rustdoc` tests.
|
||||||
- Fixed clippy lints.
|
- Fixed clippy lints.
|
||||||
|
- Fixed the memory layout of the internal `UnionNode<T>` type, fixing possible Undefined Behaviour.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ pub trait Node: Sized {
|
|||||||
fn next_mut(&mut self) -> &mut AtomicPtr<Self>;
|
fn next_mut(&mut self) -> &mut AtomicPtr<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[repr(C)]
|
||||||
pub union UnionNode<T> {
|
pub union UnionNode<T> {
|
||||||
next: ManuallyDrop<AtomicPtr<UnionNode<T>>>,
|
next: ManuallyDrop<AtomicPtr<UnionNode<T>>>,
|
||||||
pub data: ManuallyDrop<T>,
|
pub data: ManuallyDrop<T>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user