Macro architect_api::pool

source ·
macro_rules! pool {
    ($vis:vis, $name:ident, $ty:ty, $max_capacity:expr, $max_elt_size:expr) => { ... };
    ($name:ident, $ty:ty, $max_capacity:expr, $max_elt_size:expr) => { ... };
}
Expand description

static pooled objects to avoid allocation

pool(vis, name, type, capacity, max_elt_size)

Create a static memory pool. Objects are taken from the pool or allocated normally if it is empty, when they are dropped instead of being deallocated they are cleared and inserted into the pool, up to capacity elements no more than max_elt_size may be stored in the pool.