Skip to main content

Module c_vec

Module c_vec 

Source
Expand description

Equivalent of Rust’s Vec<T>, but using relibc’s own allocator.

Structs§

AllocError
Error that occurs when an allocation fails
CVec
A normal vector allocated in Rust needs to be dropped from Rust too, in order to avoid UB. This CVec is an abstraction that works using only C allocations functions and can therefore be dropped from C. Just like the Rust Vec, this does bounds checks to assure you never reach isize::MAX. Unless you need to drop something from C, prefer Rust’s builtin Vec.