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. -
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_allocationsfeature. Purpose is to prevent--all-featuresenabling allocation tracking.
Re-exports§
Modules§
- hash_
map - A hash map without
Drop, that usesFxHasherto hash keys, and stores data in arena allocator. - hash_
set - A hash set 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.
- 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.