refactor(allocator): remove pointless Option in Arena::new_chunk_memory_details#21746
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
Refactors Arena::new_chunk_memory_details to take a usize instead of an Option<usize>, since all in-tree callers always provided Some(...).
Changes:
- Updated
Arena::new_chunk_memory_detailssignature fromOption<usize>tousizeand simplified internal handling. - Updated callers in arena creation and slow-path allocation to pass a plain
usize. - Replaced a
checked_addoverflow check with direct addition when computing final chunk size.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
crates/oxc_allocator/src/arena/create.rs |
Updates new_chunk_memory_details signature/logic and adjusts initial chunk allocation path. |
crates/oxc_allocator/src/arena/alloc_impl.rs |
Updates slow-path allocation code to call the new usize-based API. |
e6c6a7f to
b91d01a
Compare
2b2a93a to
1a1387a
Compare
b91d01a to
5f66c03
Compare
6453ad5 to
dfeb5e2
Compare
5f66c03 to
0f4d918
Compare
Merge activity
|
…emory_details` (#21746) Refactor. `Arena::new_chunk_memory_details` was taking an `Option<usize>` as param, but all callers passed it `Some`. Remove the pointless `Option` wrapper.
0f4d918 to
a5c562f
Compare
dfeb5e2 to
7f7df2b
Compare

Refactor.
Arena::new_chunk_memory_detailswas taking anOption<usize>as param, but all callers passed itSome. Remove the pointlessOptionwrapper.