Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/environ/src/collections.rs
3054 views
1
//! Fallible, OOM-handling collections.
2
3
mod entity_set;
4
mod hash_map;
5
mod hash_set;
6
mod primary_map;
7
mod secondary_map;
8
9
pub use entity_set::EntitySet;
10
pub use hash_map::HashMap;
11
pub use hash_set::HashSet;
12
pub use primary_map::PrimaryMap;
13
pub use secondary_map::SecondaryMap;
14
pub use wasmtime_core::alloc::{String, TryClone, TryNew, Vec, try_new};
15
16
/// Collections which abort on OOM.
17
//
18
// FIXME(#12069) this is just here for Wasmtime at this time. Ideally
19
// collections would only be fallible in this module and would handle OOM. We're
20
// in a bit of a transition period though.
21
pub mod oom_abort {
22
#[cfg(not(feature = "std"))]
23
pub use hashbrown::{hash_map, hash_set};
24
#[cfg(feature = "std")]
25
pub use std::collections::{hash_map, hash_set};
26
27
pub use self::hash_map::HashMap;
28
pub use self::hash_set::HashSet;
29
}
30
31