2 unstable releases

Uses old Rust 2015

0.2.0 Oct 30, 2018
0.1.0 Oct 28, 2018

#469 in Memory management

Download history 4919/week @ 2024-07-19 4581/week @ 2024-07-26 4424/week @ 2024-08-02 4476/week @ 2024-08-09 4144/week @ 2024-08-16 4782/week @ 2024-08-23 5527/week @ 2024-08-30 5863/week @ 2024-09-06 7532/week @ 2024-09-13 6901/week @ 2024-09-20 7740/week @ 2024-09-27 8221/week @ 2024-10-04 9573/week @ 2024-10-11 10630/week @ 2024-10-18 9920/week @ 2024-10-25 7402/week @ 2024-11-01

39,049 downloads per month
Used in 129 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