You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While adding ReallocPlacement to get rid of grow_in_place and shrink_in_place I noticed, that neither of them returning a pointer, so the signatures can't be merged.
If we restructure the signatures of AllocRef a bit, we'll get a more convenient interface. First, I'll introduce a new struct:
This API feels much more rusty. It returns a block when allocating, it's passed as mutable reference, when it is changed, and it's moved out of scope when deallocating.
The text was updated successfully, but these errors were encountered:
Overhaul of the `AllocRef` trait to match allocator-wg's latest consens; Take 2
GitHub won't let me reopen rust-lang#69889 so I make a new PR.
In addition to rust-lang#69889 this fixes the unsoundness of `RawVec::into_box` when using allocators supporting overallocating. Also it uses `MemoryBlock` in `AllocRef` to unify `_in_place` methods by passing `&mut MemoryBlock`. Additionally, `RawVec` now checks for `size_of::<T>()` again and ignore every ZST. The internal capacity of `RawVec` isn't used by ZSTs anymore, as `into_box` now requires a length to be specified.
r? @Amanieufixesrust-lang/wg-allocators#38fixesrust-lang/wg-allocators#41fixesrust-lang/wg-allocators#44fixesrust-lang/wg-allocators#51
EDIT: Removed
MemoryLayout<T>
as #50 was closed.While adding
ReallocPlacement
to get rid ofgrow_in_place
andshrink_in_place
I noticed, that neither of them returning a pointer, so the signatures can't be merged.If we restructure the signatures of
AllocRef
a bit, we'll get a more convenient interface. First, I'll introduce a new struct:Now, the signatures of
AllocRef
can be changed:This API feels much more rusty. It returns a block when allocating, it's passed as mutable reference, when it is changed, and it's moved out of scope when deallocating.
The text was updated successfully, but these errors were encountered: