docs(allocator): correct doc comment for Allocator::from_raw_parts#22093
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR is a docs-only follow-up to #22085 that brings Allocator::from_raw_parts documentation back in sync with the allocator behavior introduced for fixed-size arenas. It clarifies the safety contract around ownership and deallocation so callers know the backing allocation is freed through std::alloc::System, not the global allocator.
Changes:
- Update
Allocator::from_raw_partsdocs to state that dropped allocators free backing memory viaSystem. - Correct the safety requirements to say the backing allocation must originate from
Systemunless cleanup is handled manually. - Add an explicit intra-doc link for
System.
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
…22093) Comments-only change. #22085 altered the docs for `Arena::from_raw_parts` to reflect that arena chunk created by this method will be deallocated via `System` allocator by default, but neglected to update docs for `Allocator::from_raw_parts`. Update the doc comment for this method to bring it into sync.
fe3d952 to
3e152c6
Compare
0ffd123 to
62ec410
Compare
### 💥 BREAKING CHANGES - 0ffbe0d allocator: [**BREAKING**] Remove `Allocator::end_ptr` method (#21871) (overlookmotel) ### 🚀 Features - 9593ec8 transformer/jsx: Add jsxDEV source metadata for fragments (#21932) (Ido Rosenthal) ### 🐛 Bug Fixes - 429deac napi/parser: Export `visitorKeys` from `wasm` entrypoint (#21996) (NullVoxPopuli) - e852911 codegen: Preserve legal comments orphaned by upstream passes (#21575) (Dunqing) - e3399ec transformer/class-properties: Preserve RHS in logical-assignment to static private field (#21950) (Dunqing) - c59c199 transformer/typescript: Emit class fields for parameter properties (#21831) (Dunqing) - aaabde4 parser: Attach legal comments to following token (#21670) (Dunqing) ### ⚡ Performance - 0bf0cb9 allocator: Per-platform `Arena::new_fixed_size` implementations (#22088) (overlookmotel) ### 📚 Documentation - 62ec410 allocator: Correct doc comment for `Allocator::from_raw_parts` (#22093) (overlookmotel) - 3e152c6 allocator: Correct typos in comments (#22092) (overlookmotel) - e220855 allocator: Correct doc comment for `Allocator::set_cursor_ptr` (#21866) (overlookmotel) --------- Co-authored-by: Boshen <[email protected]> Co-authored-by: Cameron Clark <[email protected]>

Comments-only change. #22085 altered the docs for
Arena::from_raw_partsto reflect that arena chunk created by this method will be deallocated viaSystemallocator by default, but neglected to update docs forAllocator::from_raw_parts. Update the doc comment for this method to bring it into sync.