Skip to content

docs(allocator): correct and expand safety comments on Allocator methods#13139

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-16-docs_allocator_correct_and_expand_safety_comments_on_allocator_methods
Aug 17, 2025
Merged

docs(allocator): correct and expand safety comments on Allocator methods#13139
graphite-app[bot] merged 1 commit intomainfrom
08-16-docs_allocator_correct_and_expand_safety_comments_on_allocator_methods

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Aug 16, 2025

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.

@github-actions github-actions bot added the C-docs Category - Documentation. Related to user-facing or internal documentation label Aug 16, 2025
Copy link
Member Author

overlookmotel commented Aug 16, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@overlookmotel overlookmotel marked this pull request as ready for review August 16, 2025 13:06
Copilot AI review requested due to automatic review settings August 16, 2025 13:06
Copy link
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 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 Allocator as suggested by code review
  • Expands safety documentation for Allocator::set_data_ptr with 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.

@overlookmotel overlookmotel force-pushed the 08-16-docs_allocator_correct_and_expand_safety_comments_on_allocator_methods branch from 66af7ba to 2d87e8b Compare August 16, 2025 13:07
@codspeed-hq
Copy link

codspeed-hq bot commented Aug 16, 2025

CodSpeed Instrumentation Performance Report

Merging #13139 will not alter performance

Comparing 08-16-docs_allocator_correct_and_expand_safety_comments_on_allocator_methods (33ce529) with main (5887053)1

Summary

✅ 34 untouched benchmarks

Footnotes

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

@overlookmotel overlookmotel force-pushed the 08-16-docs_allocator_correct_and_expand_safety_comments_on_allocator_methods branch 2 times, most recently from b0bb49a to 1900b28 Compare August 16, 2025 18:10
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Aug 17, 2025
Copy link
Member

Dunqing commented Aug 17, 2025

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.
@graphite-app graphite-app bot force-pushed the 08-16-docs_allocator_correct_and_expand_safety_comments_on_allocator_methods branch from 1900b28 to 33ce529 Compare August 17, 2025 13:24
@graphite-app graphite-app bot merged commit 33ce529 into main Aug 17, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 08-16-docs_allocator_correct_and_expand_safety_comments_on_allocator_methods branch August 17, 2025 13:29
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants