docs(allocator): correct and expand safety comments on Allocator methods#13139
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 improves and corrects safety documentation for the Allocator trait methods. The changes focus on clarifying safety invariants and adding detailed comments about proper usage patterns to prevent undefined behavior.
- Corrects safety comments on safe methods of
Allocatoras suggested by code review - Expands safety documentation for
Allocator::set_data_ptrwith detailed invariants - Adds comments explaining how invariants are maintained at call sites
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/oxc_allocator/src/pool_fixed_size.rs | Adds clarifying safety comment about restoring original data pointer |
| crates/oxc_allocator/src/from_raw_parts.rs | Expands safety documentation and corrects grammar in multiple method comments |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
66af7ba to
2d87e8b
Compare
CodSpeed Instrumentation Performance ReportMerging #13139 will not alter performanceComparing Summary
Footnotes |
b0bb49a to
1900b28
Compare
Merge activity
|
…thods (#13139) Correct safety comments on unsafe methods of `Allocator`, as suggested by AI in #13134 (review). Also expand the safety comments for `Allocator::set_data_ptr`, and add comments on how its invariants are upheld at call sites. Also correct typos and improve comment formatting.
1900b28 to
33ce529
Compare

Correct safety comments on unsafe methods of
Allocator, as suggested by AI in #13134 (review).Also expand the safety comments for
Allocator::set_data_ptr, and add comments on how its invariants are upheld at call sites.Also correct typos and improve comment formatting.