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 forBoxandVecwithserdeandoxc_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. -
fixed_size- MakesAllocatorPoolcreate large fixed-size allocators, instead of flexibly-sized ones. Only supported on 64-bit little-endian platforms at present. Usage of this feature is not advisable, and it will be removed as soon as we’re able to. -
disable_fixed_size- Disablesfixed_sizefeature. Purpose is to prevent--all-featuresenabling fixed sized allocators.
Re-exports§
pub use hash_map::HashMap;
Modules§
- hash_
map - A hash map without
Drop, that usesFxHasherto hash keys, and stores data in arena allocator.
Structs§
- Address
- Memory address of an AST node in arena.
- Allocator
- A bump-allocated memory arena.
- Allocator
Guard - A guard object representing exclusive access to an
Allocatorfrom the pool. - Allocator
Pool - A thread-safe pool for reusing
Allocatorinstances to reduce allocation overhead. - Box
- A
BoxwithoutDrop, which stores its data in the arena allocator. - String
Builder - String builder.
- Vec
- A
VecwithoutDrop, which stores its data in the arena allocator.
Traits§
- Allocator
Accessor - 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
Fromtrait. - GetAddress
- Trait for getting the memory address of an AST node.
- IntoIn
- This trait works similarly to the standard library
Intotrait. It is similar toFromInis reflective, AFromInimplementation also implicitly implementsIntoInfor the opposite type. - TakeIn
- A trait to replace an existing AST node with a dummy.