Closed JieningYu closed 5 months ago
Freeing an allocation requires dropping an Allocation value, but there's no way to create a new Allocation from raw parts, unsafely.
Allocation
This pull request introduces the function (with into_raw_parts), which is similar with Vec::from_raw_parts.
into_raw_parts
Vec::from_raw_parts
Thanks for the PR! I've never come across a use case for this myself, but it's a reasonable addition (especially considering it being somewhat analogous to Vec's counterpart).
Freeing an allocation requires dropping an
Allocation
value, but there's no way to create a newAllocation
from raw parts, unsafely.This pull request introduces the function (with
into_raw_parts
), which is similar withVec::from_raw_parts
.