2 unstable releases

Uses old Rust 2015

0.2.0 Oct 30, 2018
0.1.0 Oct 28, 2018

#139 in Memory management

Download history 4095/week @ 2021-10-03 6336/week @ 2021-10-10 8740/week @ 2021-10-17 10797/week @ 2021-10-24 6156/week @ 2021-10-31 7946/week @ 2021-11-07 9455/week @ 2021-11-14 6957/week @ 2021-11-21 8207/week @ 2021-11-28 8543/week @ 2021-12-05 3360/week @ 2021-12-12 2966/week @ 2021-12-19 3031/week @ 2021-12-26 2668/week @ 2022-01-02 4194/week @ 2022-01-09 5041/week @ 2022-01-16

15,204 downloads per month
Used in 20 crates (via lockfree)

MIT license

31KB
634 lines

Owned Alloc

This is an attempt of reducing erros with manual memory allocation in Rust. See docs for more details.

Docs: https://bzim.gitlab.io/owned-alloc/owned_alloc/


lib.rs:

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.

No runtime deps

p[