Crates.io | oxc_allocator |
lib.rs | oxc_allocator |
version | 0.83.0 |
created_at | 2023-03-30 15:46:06.879476+00 |
updated_at | 2025-08-29 06:51:06.795238+00 |
description | A collection of JavaScript tools written in Rust. |
homepage | https://oxc.rs |
repository | https://github.com/oxc-project/oxc |
max_upload_size | |
id | 825225 |
size | 293,410 |
A high-performance memory allocator using bump-based arena allocation for fast AST node creation.
Oxc uses a bump-based memory arena for faster AST allocations. This crate provides an [Allocator
] that manages memory efficiently by allocating objects in a single contiguous memory region, avoiding the overhead of individual heap allocations.
Box
, Vec
, String
, and HashMap
implementationsThe allocator is designed specifically for AST processing workflows where:
This approach is significantly faster than using the system allocator for AST operations.
serialize
- Enables serialization support for Box
and Vec
with serde
and oxc_estree
.from_raw_parts
- Adds unsafe from_raw_parts
method (not recommended for general use).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_fixed_size
- Disables fixed_size
feature.
Purpose is to prevent --all-features
enabling fixed sized allocators.disable_track_allocations
- Disables track_allocations
feature.
Purpose is to prevent --all-features
enabling allocation tracking.