[−][src]Crate owned_alloc
Owned Allocations. A crate to help reducing manual memory management errors.
The idea is to use a type like UninitAlloc
for uninitialized dynamic
allocations. After initializing it, you have a OwnedAlloc
which is pretty
similar to a Box
. However, unlike a Box
, you may move the value out from
the OwnedAlloc
and getting an UninitAlloc
back.
For vec-like structures, a type RawVec
is available, pretty similar to the
one used by the standard library. Currently, no other help is provided for
arrays/vectors.
There is also a type Cache
, which is actually more general than
allocation, but may be useful for allocations. It can save unused
allocations requested on a tight loop.
Structs
AllocErr |
Error returned from the allocator. |
Cache |
A general purpouse cache suitable for saving discarted memory allocations in a tight loop. |
LayoutErr |
Error caused by invalid size or alignment. |
OwnedAlloc |
Dynamic allocation of a |
RawVec |
Raw Vector allocation. This allocation, instead of holding a pointer to a
single |
UninitAlloc |
Dynamic allocation of a |
Enums
MaybeUninitAlloc |
Pointer to memory allocaation that might be either initialized or
uninitialized. For the drop checker, the type acts as if it contains a |
RawVecErr |
Errors returned by the |