Does an empty im::HashMap allocate any object on the heap?
I am trying to figure out if it makes sense to use Option<im::HashMap<K, V>>
or if HashMap<K, V>
already automatically does said optimization when empty.
im::HashMap::new()
points to im::HashMap::default()
, at https://docs.rs/im/15.0.0/src/im/hash/map.rs.html#126-128 , which appears to be doing some type of allocation from the pool, but I am not sure.
EDIT: link for default
: https://docs.rs/im/15.0.0/src/im/hash/map.rs.html#1642