Crate oxc_allocator

Source
Expand description

§⚓ Oxc Memory Allocator

Oxc uses a bump-based memory arena for faster AST allocations.

This crate contains an Allocator for creating such arenas, as well as ports of data types from std adapted to use this arena:

See Allocator docs for information on efficient use of Allocator.

§Features

  • serialize - Enables serialization support for Box and Vec with serde and oxc_estree.

  • from_raw_parts - Adds [Allocator::from_raw_parts] method. Usage of this feature is not advisable, and it will be removed as soon as we’re able to.

Re-exports§

pub use hash_map::HashMap;

Modules§

hash_map
A hash map without Drop, that uses FxHasher to hash keys, and stores data in arena allocator.

Macros§

vec
Creates a Vec containing the arguments.

Structs§

Address
Memory address of an AST node in arena.
Allocator
A bump-allocated memory arena.
Box
A Box without Drop, which stores its data in the arena allocator.
StringBuilder
String builder.
Vec
A Vec without Drop, which stores its data in the arena allocator.

Traits§

AllocatorAccessor
Accessor for getting the underlying allocator.
CloneIn
A trait to explicitly clone an object into an arena allocator.
Dummy
A trait to create a dummy AST node.
FromIn
This trait works similarly to the standard library From trait.
GetAddress
Trait for getting the memory address of an AST node.
IntoIn
This trait works similarly to the standard library Into trait. It is similar to FromIn is reflective, A FromIn implementation also implicitly implements IntoIn for the opposite type.
TakeIn
A trait to replace an existing AST node with a dummy.