Skip to content

docs(allocator): correct doc comment for Allocator::set_cursor_ptr#21866

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/04-27-docs_allocator_correct_doc_comment_for_allocator_set_cursor_ptr_
Apr 27, 2026
Merged

docs(allocator): correct doc comment for Allocator::set_cursor_ptr#21866
graphite-app[bot] merged 1 commit intomainfrom
om/04-27-docs_allocator_correct_doc_comment_for_allocator_set_cursor_ptr_

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Apr 27, 2026

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

Copy link
Copy Markdown
Member Author

overlookmotel commented Apr 27, 2026

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 27, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/04-27-docs_allocator_correct_doc_comment_for_allocator_set_cursor_ptr_ (e220855) with main (e7f8d55)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (76ee605) during the generation of this report, so e7f8d55 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel marked this pull request as ready for review April 27, 2026 22:56
Copilot AI review requested due to automatic review settings April 27, 2026 22:56
@overlookmotel overlookmotel added C-docs Category - Documentation. Related to user-facing or internal documentation A-allocator Area - Allocator labels Apr 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to MIN_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.

@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Apr 27, 2026

Merge activity

…21866)

Comments-only change. Correct safety documentation for `Allocator::set_cursor_ptr` and `Arena::set_cursor_ptr`.
@graphite-app graphite-app Bot force-pushed the om/04-26-refactor_allocator_chunkfooter_store_pointer_to_backing_allocation branch from 1a4aa2a to 76ee605 Compare April 27, 2026 23:32
@graphite-app graphite-app Bot force-pushed the om/04-27-docs_allocator_correct_doc_comment_for_allocator_set_cursor_ptr_ branch from 6d17208 to e220855 Compare April 27, 2026 23:33
Base automatically changed from om/04-26-refactor_allocator_chunkfooter_store_pointer_to_backing_allocation to main April 27, 2026 23:39
@graphite-app graphite-app Bot merged commit e220855 into main Apr 27, 2026
38 checks passed
@graphite-app graphite-app Bot deleted the om/04-27-docs_allocator_correct_doc_comment_for_allocator_set_cursor_ptr_ branch April 27, 2026 23:40
camc314 added a commit that referenced this pull request May 5, 2026
### 💥 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-allocator Area - Allocator C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants