use pstd::{
BoxA, String, VecA,
collections::btree_map::CustomTuning,
collections::{BTreeMap, BTreeSet, DefaultHashBuilder, HashMap},
rc::{Rc, RcStr},
};
pub use pstd::localalloc::{Local, Temp};
pub fn local() -> Local {
Local::new()
}
pub fn temp() -> Temp {
Temp::new()
}
pub type TBox<T> = BoxA<T, Temp>;
pub type TVec<T> = VecA<T, Temp>;
pub type LBox<T> = BoxA<T, Local>;
pub type LRc<T> = Rc<T, Local>;
pub type LRcStr = RcStr<Local>;
pub type LVec<T> = VecA<T, Local>;
pub type LString = String<Local>;
pub type LBTreeMap<K, V> = BTreeMap<K, V, CustomTuning<Local>>;
pub fn lbtreemap<K, V>() -> LBTreeMap<K, V> {
LBTreeMap::new_in(local())
}
pub type LBTreeSet<T> = BTreeSet<T, CustomTuning<Local>>;
pub fn lbtreeset<T>() -> LBTreeSet<T> {
LBTreeSet::new_in(local())
}
pub type LHashMap<K, V> = HashMap<K, V, DefaultHashBuilder, Local>;
pub fn lhashmap<K, V>() -> LHashMap<K, V> {
LHashMap::new_in(local())
}
#[cfg(feature = "dynbox")]
pub type DBox<T> = LBox<T>;
#[cfg(not(feature = "dynbox"))]
pub type DBox<T> = std::boxed::Box<T>;
pub fn dbox<T>(t: T) -> DBox<T> {
DBox::new(t)
}