Commit Graph

6 Commits

Author SHA1 Message Date
overlookmotel edc70eae97 refactor(allocator/pool)!: remove disable_fixed_size Cargo feature (#13625)
#13622 and #13624 altered what happens when the `fixed_size` Cargo feature is enabled. Previously, enabling that feature altered behavior of `AllocatorPool`. Now the feature is additive - it does nothing on it's own, but only adds additional APIs, and *those APIs* can be used to alter behavior.

The purpose of the `disable_fixed_size` Cargo feature was to prevent the `fixed_size` feature being activated when tests are run with `--all-features`. Now that enabling `fixed_size` feature doesn't alter behavior, we don't need to worry about it being enabled in tests. Therefore `disable_fixed_size` feature can be removed.

This removes a bunch of `#[cfg]` boilerplate, and ugly hacks which were previously required to workaround feature unification.
2025-09-10 04:14:29 +00:00
overlookmotel afa087722c feat(allocator): introduce BitSet type (#13449)
#13419 introduced a `BitSet` type which stores its data in the arena, in the mangler.

This type may be useful in other contexts, so move it from `oxc_mangler` into `oxc_allocator`. But put it behind a `bitset` feature, so only crates which use it pay for it.
2025-08-31 04:59:26 +00:00
overlookmotel df8e639a2e refactor(allocator)!: put AllocatorPool behind pool feature (#13373)
`AllocatorPool` is only used in linter. Parser, transformer, minifier etc don't need it. So put it behind a `pool` cargo feature.

This complicates the many `#[cfg]` attrs even further, but this is preparation for merging the 2 `AllocatorPool` implementations, and removing the `fixed_size` feature, which will remove a lot of this `#[cfg]` mess.
2025-08-29 16:51:18 +00:00
overlookmotel 304830299a docs(allocator): document all cargo features (#13104)
`README` and doc comment in `lib.rs` were out of sync and both missed out some of `oxc_allocator`'s cargo features. Document all the features in both places.
2025-08-14 20:58:40 +00:00
overlookmotel 4f31b734e6 refactor(allocator): move allocation tracking code into own module (#12937)
Follow-on after #12555. Pure refactor.

Move code related to allocation tracking into its own module, and introduce an `AllocationStats` struct.

This reduces noise in `allocator.rs` and `alloc.rs`, with less repetitions of `#[cfg(all(feature = "track_allocations", not(feature = "disable_track_allocations")))]` etc.

Also bulk out the doc comments explaining the unsoundness, and how we must take care to avoid allocation tracking code being compiled in production code.
2025-08-09 14:24:01 +00:00
Copilot de1de35c07 docs(rust): Add comprehensive README.md documentation for all Rust crates (#12706) 2025-08-01 18:13:46 +08:00