mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-10-02 14:54:30 +00:00
Recover StableDeref trait for pool::object::Object and pool::boxed::Box
This commit is contained in:
parent
f01eb295d4
commit
8a57a69c9b
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Added an object pool API. see the `pool::object` module level doc for details
|
- Added an object pool API. see the `pool::object` module level doc for details
|
||||||
- Add `HistoryBuffer::as_slices()`
|
- Add `HistoryBuffer::as_slices()`
|
||||||
- Implemented `retain` for `IndexMap` and `IndexSet`.
|
- Implemented `retain` for `IndexMap` and `IndexSet`.
|
||||||
|
- Recover `StableDeref` trait for `pool::object::Object` and `pool::boxed::Box`.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -84,6 +84,8 @@ use core::{
|
|||||||
ops, ptr,
|
ops, ptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use stable_deref_trait::StableDeref;
|
||||||
|
|
||||||
use super::treiber::{NonNullPtr, Stack, UnionNode};
|
use super::treiber::{NonNullPtr, Stack, UnionNode};
|
||||||
|
|
||||||
/// Creates a new `BoxPool` singleton with the given `$name` that manages the specified `$data_type`
|
/// Creates a new `BoxPool` singleton with the given `$name` that manages the specified `$data_type`
|
||||||
@ -212,6 +214,8 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl<P> StableDeref for Box<P> where P: BoxPool {}
|
||||||
|
|
||||||
impl<A> fmt::Display for Box<A>
|
impl<A> fmt::Display for Box<A>
|
||||||
where
|
where
|
||||||
A: BoxPool,
|
A: BoxPool,
|
||||||
|
@ -71,6 +71,8 @@ use core::{
|
|||||||
ops, ptr,
|
ops, ptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use stable_deref_trait::StableDeref;
|
||||||
|
|
||||||
use super::treiber::{AtomicPtr, NonNullPtr, Stack, StructNode};
|
use super::treiber::{AtomicPtr, NonNullPtr, Stack, StructNode};
|
||||||
|
|
||||||
/// Creates a new `ObjectPool` singleton with the given `$name` that manages the specified
|
/// Creates a new `ObjectPool` singleton with the given `$name` that manages the specified
|
||||||
@ -220,6 +222,8 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl<A> StableDeref for Object<A> where A: ObjectPool {}
|
||||||
|
|
||||||
impl<A> fmt::Display for Object<A>
|
impl<A> fmt::Display for Object<A>
|
||||||
where
|
where
|
||||||
A: ObjectPool,
|
A: ObjectPool,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user