Skip to main content

Module allocation

Module allocation 

Source
Expand description

Backend-neutral fallible allocation reservation helpers. Backend-neutral fallible allocation reservation helpers.

Concrete backends still own domain wording, but the arithmetic for “reserve additional” and “reserve up to target capacity” must not drift.

Functions§

reserve_hash_map_to_capacity
Ensure a HashMap can hold target_capacity entries without changing length.
reserve_hash_set_to_capacity
Ensure a HashSet can hold target_capacity entries without changing length.
reserve_smallvec_additional
Reserve additional capacity for a SmallVec without changing its length.
reserve_smallvec_to_capacity
Ensure a SmallVec can hold target_capacity items without changing length.
reserve_vec_additional
Reserve additional capacity for a Vec without changing its length.
reserve_vec_to_capacity
Ensure a Vec can hold target_capacity items without changing length.
try_reserve_hash_map_to_capacity
Ensure a HashMap can hold target_capacity entries without changing length, returning the standard allocation error for domain-specific adapters.
try_reserve_hash_set_to_capacity
Ensure a HashSet can hold target_capacity entries without changing length, returning the standard allocation error for domain-specific adapters.
try_reserve_vec_to_capacity
Ensure a Vec can hold target_capacity items without changing length, returning the standard allocation error for domain-specific adapters.