oxc_allocator/lib.rs
1//! # ⚓ Oxc Memory Allocator
2//!
3//! Oxc uses a bump-based memory arena for faster AST allocations.
4//!
5//! This crate contains an [`Allocator`] for creating such arenas, as well as ports of data types
6//! from `std` adapted to use this arena:
7//!
8//! * [`Box`]
9//! * [`Vec`]
10//! * [`String`]
11//! * [`HashMap`]
12//!
13//! See [`Allocator`] docs for information on efficient use of [`Allocator`].
14//!
15//! ## Features
16//!
17//! * `serialize` - Enables serialization support for [`Box`] and [`Vec`] with `serde` and `oxc_estree`.
18//!
19//! * `from_raw_parts` - Adds [`Allocator::from_raw_parts`] method.
20//! Usage of this feature is not advisable, and it will be removed as soon as we're able to.
21
22#![warn(missing_docs)]
23
24mod accessor;
25mod address;
26mod alloc;
27mod allocator;
28mod allocator_api2;
29mod boxed;
30mod clone_in;
31mod convert;
32#[cfg(feature = "from_raw_parts")]
33mod from_raw_parts;
34pub mod hash_map;
35mod pool;
36mod string_builder;
37mod take_in;
38mod vec;
39mod vec2;
40
41pub use accessor::AllocatorAccessor;
42pub use address::{Address, GetAddress};
43pub use allocator::Allocator;
44pub use boxed::Box;
45pub use clone_in::CloneIn;
46pub use convert::{FromIn, IntoIn};
47pub use hash_map::HashMap;
48pub use pool::{AllocatorGuard, AllocatorPool};
49pub use string_builder::StringBuilder;
50pub use take_in::{Dummy, TakeIn};
51pub use vec::Vec;