Skip to main content

ocas_core/
lib.rs

1//! Core runtime, memory management, and backend glue for oCAS.
2//!
3//! This crate provides the foundation used by all other oCAS crates:
4//! - arena allocation for expression nodes
5//! - unified error types
6//! - thread pool utilities
7//! - FFI glue conventions
8//! - thin wrappers around numerical backends (GMP, MPFR, FLINT, etc.)
9
10#![warn(missing_docs)]
11
12pub mod arena;
13pub mod error;
14pub mod fuel;
15pub mod thread_pool;
16
17/// Hash map using the DoS-resistant, high-performance `ahash` hasher.
18///
19/// Prefer this over [`std::collections::HashMap`] on hot paths
20/// (polynomial term tables, hash-consing, CSE maps); std's SipHash is
21/// needlessly slow for trusted internal keys.
22pub type FastHashMap<K, V> = std::collections::HashMap<K, V, ahash::RandomState>;
23
24/// Hash set using the `ahash` hasher. See [`FastHashMap`].
25pub type FastHashSet<K> = std::collections::HashSet<K, ahash::RandomState>;
26
27#[cfg(feature = "gmp")]
28pub mod gmp;