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 forBox
andVec
withserde
andoxc_estree
. -
pool
- Enables [AllocatorPool
]. -
bitset
- Enables [BitSet
]. -
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
- Makes [AllocatorPool
] create 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. -
track_allocations
- Count allocations and reallocations. For internal use only. The APIs provided by this feature are sketchy at best, and possibly undefined behavior. Do not enable this feature under any circumstances in production code. -
disable_track_allocations
- Disablestrack_allocations
feature. Purpose is to prevent--all-features
enabling allocation tracking.
Re-exports§
pub use hash_map::HashMap;
Modules§
- hash_
map - A hash map without
Drop
, that usesFxHasher
to hash keys, and stores data in arena allocator.
Structs§
- Address
- Memory address of an AST node in arena.
- Allocator
- A bump-allocated memory arena.
- Box
- A
Box
withoutDrop
, which stores its data in the arena allocator. - String
Builder - String builder.
- Vec
- A
Vec
withoutDrop
, 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
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 toFromIn
is reflective, AFromIn
implementation also implicitly implementsIntoIn
for the opposite type. - TakeIn
- A trait to replace an existing AST node with a dummy.