Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::alloc: use posix_memalign instead of memalign on solarish #124798

Merged
merged 1 commit into from
May 12, 2024

Conversation

devnexen
Copy link
Contributor

@devnexen devnexen commented May 6, 2024

memalign on Solarish requires the alignment to be at least the size of a pointer, which we did not honor. posix_memalign also requires that, but that code path already takes care of this requirement.

close GH-124787

@rustbot
Copy link
Collaborator

rustbot commented May 6, 2024

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 6, 2024
@rust-log-analyzer

This comment has been minimized.

@joboet joboet 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-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 8, 2024

Some changes occurred in src/tools/cargo

cc @ehuss

@devnexen devnexen force-pushed the illumos_memalign_fix branch 2 times, most recently from cbd9055 to 2fffb3a Compare May 8, 2024 20:20
@RalfJung
Copy link
Member

Can't we just use posix_memalign? Solaris and Illumos seem to both have that. Then the diff would be just two lines, as we're already using posix_memalign by default when we don't have some other special case.

@devnexen
Copy link
Contributor Author

If we do not care of solaris < 10 then it s possible indeed.

@RalfJung
Copy link
Member

RalfJung commented May 11, 2024

https://doc.rust-lang.org/rustc/platform-support.html explicitly says "Solaris 11" so I think indeed we do not care about Solaris 10 or older.

simpler code path since small alignments are already taking care of.
close rust-langGH-124787
@RalfJung
Copy link
Member

LGTM, thanks!
@bors r+

@bors
Copy link
Contributor

bors commented May 12, 2024

📌 Commit 1e232fe has been approved by RalfJung

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 12, 2024
@RalfJung RalfJung changed the title std::alloc: checking if the alignment is, at least, a word size. std::alloc: use posix_memalign instead of memalign on solarish May 12, 2024
@bors
Copy link
Contributor

bors commented May 12, 2024

⌛ Testing commit 1e232fe with merge b71fa82...

@bors
Copy link
Contributor

bors commented May 12, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing b71fa82 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 12, 2024
@bors bors merged commit b71fa82 into rust-lang:master May 12, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 12, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b71fa82): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.1% [-2.4%, -1.8%] 4
Improvements ✅
(secondary)
-3.6% [-4.2%, -2.9%] 2
All ❌✅ (primary) -2.1% [-2.4%, -1.8%] 4

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 677.159s -> 675.425s (-0.26%)
Artifact size: 315.94 MiB -> 315.92 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Solarish: standard allocator uses memalign incorrectly
8 participants