Skip to content

Commit a35c1e2

Browse files
committed
docs(allocator): document all cargo features
1 parent 1c15288 commit a35c1e2

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

crates/oxc_allocator/README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ This approach is significantly faster than using the system allocator for AST op
2525

2626
## Features
2727

28-
- `serialize` - Enables serialization support for `Box` and `Vec` with `serde`
29-
- `from_raw_parts` - Adds unsafe `from_raw_parts` method (not recommended for general use)
30-
- `track_allocations` - For internal use only. The APIs provided by this feature are sketchy at best,
31-
and possibly undefined behavior. Do not enable this feature under any circumstances in production code.
28+
- `serialize` - Enables serialization support for `Box` and `Vec` with `serde` and `oxc_estree`.
29+
- `from_raw_parts` - Adds unsafe `from_raw_parts` method (not recommended for general use).
30+
- `fixed_size` - Makes `AllocatorPool` create large fixed-size allocators, instead of flexibly-sized ones.
31+
Only supported on 64-bit little-endian platforms at present.
32+
Usage of this feature is not advisable, and it will be removed as soon as we're able to.
33+
- `track_allocations` - Count allocations and reallocations.
34+
For internal use only. The APIs provided by this feature are sketchy at best, and possibly
35+
undefined behavior. Do not enable this feature under any circumstances in production code.
36+
- `disable_fixed_size` - Disables `fixed_size` feature.
37+
Purpose is to prevent `--all-features` enabling fixed sized allocators.
38+
- `disable_track_allocations` - Disables `track_allocations` feature.
39+
Purpose is to prevent `--all-features` enabling allocation tracking.

crates/oxc_allocator/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@
2424
//! Only supported on 64-bit little-endian platforms at present.
2525
//! Usage of this feature is not advisable, and it will be removed as soon as we're able to.
2626
//!
27+
//! * `track_allocations` - Count allocations and reallocations.
28+
//! For internal use only. The APIs provided by this feature are sketchy at best, and possibly
29+
//! undefined behavior. Do not enable this feature under any circumstances in production code.
30+
//!
2731
//! * `disable_fixed_size` - Disables `fixed_size` feature.
2832
//! Purpose is to prevent `--all-features` enabling fixed sized allocators.
33+
//!
34+
//! * `disable_track_allocations` - Disables `track_allocations` feature.
35+
//! Purpose is to prevent `--all-features` enabling allocation tracking.
2936
3037
#![warn(missing_docs)]
3138

0 commit comments

Comments
 (0)