docs(allocator): correct doc comment for Allocator::set_cursor_ptr#21866
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR updates safety documentation for the raw-transfer cursor manipulation APIs (Allocator::set_cursor_ptr and Arena::set_cursor_ptr) to better reflect the actual invariants expected by the allocator internals.
Changes:
- Clarifies the cursor lower-bound requirement as “after the chunk start pointer” (vs. “data pointer”).
- Documents additional safety preconditions: write permission and (for
Arena) alignment toMIN_ALIGN.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_allocator/src/from_raw_parts.rs | Updates Allocator::set_cursor_ptr safety docs to reference the chunk start pointer and require write permission/alignment per underlying arena invariants. |
| crates/oxc_allocator/src/arena/from_raw_parts.rs | Updates Arena::set_cursor_ptr safety docs to reference the chunk start pointer and require write permission. |
Merge activity
|
…21866) Comments-only change. Correct safety documentation for `Allocator::set_cursor_ptr` and `Arena::set_cursor_ptr`.
1a4aa2a to
76ee605
Compare
6d17208 to
e220855
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 <1430279+Boshen@users.noreply.github.com> Co-authored-by: Cameron Clark <cameron.clark@hey.com>

Comments-only change. Correct safety documentation for
Allocator::set_cursor_ptrandArena::set_cursor_ptr.