2 unstable releases

Uses old Rust 2015

0.2.0 Oct 30, 2018
0.1.0 Oct 28, 2018

#433 in Memory management

Download history 4552/week @ 2023-12-14 2672/week @ 2023-12-21 2029/week @ 2023-12-28 4316/week @ 2024-01-04 4713/week @ 2024-01-11 5211/week @ 2024-01-18 4323/week @ 2024-01-25 9742/week @ 2024-02-01 11608/week @ 2024-02-08 7579/week @ 2024-02-15 6470/week @ 2024-02-22 6099/week @ 2024-02-29 6346/week @ 2024-03-07 3589/week @ 2024-03-14 4629/week @ 2024-03-21 3857/week @ 2024-03-28

19,687 downloads per month
Used in 115 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