Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Nov 5, 2025

Use Box::as_non_null method (added in #15321) to ensure that creating an Address from a Box, no intermediate reference to the contents of the Box is created. This is important in Traverse which has tight aliasing constraints.

Possibly addr_of! macro we used previously already ensured this, but I'm not 100% sure due to the double deref (**). Using Box::as_non_null is unambiguously safe.

@github-actions github-actions bot added the C-bug Category - Bug label Nov 5, 2025
Copy link
Member Author

overlookmotel commented Nov 5, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 5, 2025

CodSpeed Performance Report

Merging #15322 will improve performances by 3.83%

Comparing 11-05-fix_allocator_avoid_dereferencing_box_when_obtaining_its_address_ (ef4de9f) with 11-05-feat_allocator_add_box_as_non_null_method (4114c3b)

Summary

⚡ 1 improvement
✅ 36 untouched

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
Simulation minifier[cal.com.tsx] 37.1 ms 35.8 ms +3.83%

@overlookmotel overlookmotel marked this pull request as ready for review November 5, 2025 12:41
@overlookmotel overlookmotel force-pushed the 11-05-fix_allocator_avoid_dereferencing_box_when_obtaining_its_address_ branch from a1a0c49 to 644da49 Compare November 5, 2025 12:44
@overlookmotel overlookmotel force-pushed the 11-05-feat_allocator_add_box_as_non_null_method branch from d806f3c to f42e703 Compare November 5, 2025 12:44
@overlookmotel overlookmotel self-assigned this Nov 5, 2025
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 5, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 11-05-feat_allocator_add_box_as_non_null_method branch from f42e703 to 1274291 Compare November 5, 2025 13:46
graphite-app bot pushed a commit that referenced this pull request Nov 5, 2025
#15322)

Use `Box::as_non_null` method (added in #15321) to ensure that creating an `Address` from a `Box`, no intermediate reference to the contents of the `Box` is created. This is important in `Traverse` which has tight aliasing constraints.

Possibly `addr_of!` macro we used previously already ensured this, but I'm not 100% sure due to the double deref (`**`). Using `Box::as_non_null` is unambiguously safe.
@graphite-app graphite-app bot force-pushed the 11-05-fix_allocator_avoid_dereferencing_box_when_obtaining_its_address_ branch from 644da49 to bec140b Compare November 5, 2025 13:47
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
@overlookmotel overlookmotel force-pushed the 11-05-feat_allocator_add_box_as_non_null_method branch from 1274291 to f93b292 Compare November 5, 2025 14:54
@overlookmotel overlookmotel force-pushed the 11-05-fix_allocator_avoid_dereferencing_box_when_obtaining_its_address_ branch 2 times, most recently from 9d7b273 to ef4de9f Compare November 5, 2025 15:26
@overlookmotel overlookmotel force-pushed the 11-05-feat_allocator_add_box_as_non_null_method branch from f93b292 to 4114c3b Compare November 5, 2025 15:26
@overlookmotel
Copy link
Member Author

The benchmark results (+3% on minifier[cal.com.tsx]) are erroneous. Just noise.

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
#15322)

Use `Box::as_non_null` method (added in #15321) to ensure that creating an `Address` from a `Box`, no intermediate reference to the contents of the `Box` is created. This is important in `Traverse` which has tight aliasing constraints.

Possibly `addr_of!` macro we used previously already ensured this, but I'm not 100% sure due to the double deref (`**`). Using `Box::as_non_null` is unambiguously safe.
@graphite-app graphite-app bot force-pushed the 11-05-feat_allocator_add_box_as_non_null_method branch from 4114c3b to b401708 Compare November 5, 2025 15:41
@graphite-app graphite-app bot force-pushed the 11-05-fix_allocator_avoid_dereferencing_box_when_obtaining_its_address_ branch from ef4de9f to 55b533c Compare November 5, 2025 15:42
Base automatically changed from 11-05-feat_allocator_add_box_as_non_null_method to main November 5, 2025 15:47
@graphite-app graphite-app bot merged commit 55b533c into main Nov 5, 2025
22 checks passed
@graphite-app graphite-app bot deleted the 11-05-fix_allocator_avoid_dereferencing_box_when_obtaining_its_address_ branch November 5, 2025 15:48
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants