Skip to content

Update exchange_malloc to take Alignment too#152685

Closed
scottmcm wants to merge 1 commit intorust-lang:mainfrom
scottmcm:smaller-alignment-change
Closed

Update exchange_malloc to take Alignment too#152685
scottmcm wants to merge 1 commit intorust-lang:mainfrom
scottmcm:smaller-alignment-change

Conversation

@scottmcm
Copy link
Member

@scottmcm scottmcm commented Feb 16, 2026

#152605 updated the shim (__rust_alloc and friends), but not the special one that box uses. So do that one too.

This is split out from #152641 in hopes of simplifying things.

r? @cjgillot

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 16, 2026
@cjgillot
Copy link
Contributor

r=me if perf is ok

@scottmcm
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 16, 2026
Update `exchange_malloc` to take `Alignment` too
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 16, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 16, 2026

☀️ Try build successful (CI)
Build commit: ee4b7f6 (ee4b7f6be1ff7c54d2f794480518f9e5528e5034, parent: 139651428df86cf88443295542c12ea617cbb587)

@rust-timer

This comment has been minimized.

@scottmcm scottmcm force-pushed the smaller-alignment-change branch from 953e0dd to 20b897d Compare February 16, 2026 05:16
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ee4b7f6): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.5%, 1.6%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-2.9%, -0.5%] 8
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -6.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-6.2% [-10.2%, -3.8%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -6.2% [-10.2%, -3.8%] 3

Cycles

Results (primary -2.6%, secondary 0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.1% [2.4%, 4.0%] 3
Improvements ✅
(primary)
-2.6% [-3.0%, -2.2%] 2
Improvements ✅
(secondary)
-2.8% [-3.5%, -2.3%] 3
All ❌✅ (primary) -2.6% [-3.0%, -2.2%] 2

Binary size

Results (primary 0.8%, secondary -1.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-2.0%, -0.4%] 11
All ❌✅ (primary) 0.8% [0.8%, 0.8%] 1

Bootstrap: 482.657s -> 482.787s (0.03%)
Artifact size: 397.96 MiB -> 397.99 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 16, 2026
@scottmcm
Copy link
Member Author

No changes in primary. Secondary is mixed, but overall green.

@bors r=cjgillot

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 16, 2026

📌 Commit 20b897d has been approved by cjgillot

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 16, 2026
@RalfJung
Copy link
Member

Ah, more conflicts for the box_new PR :/

@scottmcm
Copy link
Member Author

scottmcm commented Feb 16, 2026

Is that one just deleting exchange_malloc, Ralf? If so, feel free to r- this since it looks like it just got r='d.

I see the note in that one that

I'd suggest we can try passing a Layout in a future, separate PR.

so I could just change this one to be that change.

@scottmcm
Copy link
Member Author

Oh, yeah, looking at compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs in that PR I'll just

@bors r-

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 16, 2026
@scottmcm scottmcm added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Feb 16, 2026
@RalfJung
Copy link
Member

RalfJung commented Feb 16, 2026 via email

@scottmcm
Copy link
Member Author

As a regular function is great! I never wanted to touch mir-build to do this :)

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 16, 2026

☔ The latest upstream changes (presumably #148190) made this pull request unmergeable. Please resolve the merge conflicts.

@scottmcm
Copy link
Member Author

Closed in favour of #152737

@scottmcm scottmcm closed this Feb 17, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants