Use a single static for all default slice Arcs.#125283
Merged
bors merged 5 commits intorust-lang:masterfrom May 20, 2024
Merged
Use a single static for all default slice Arcs.#125283bors merged 5 commits intorust-lang:masterfrom
bors merged 5 commits intorust-lang:masterfrom
Conversation
Also adds debug_asserts in Drop for Weak/Arc that the shared static is not being "dropped"/"deallocated".
This comment has been minimized.
This comment has been minimized.
dtolnay
requested changes
May 19, 2024
Member
dtolnay
left a comment
There was a problem hiding this comment.
Thank you!
Adding the debug asserts in Drop is a wonderful idea.
| struct SliceArcInnerForStatic { | ||
| inner: ArcInner<[u8; 1]>, | ||
| } | ||
| const MAX_STATIC_INNER_SLICE_ALIGNMENT: usize = 16; |
Member
There was a problem hiding this comment.
This needs a #[cfg(not(no_global_oom_handling))], since the Default impls using this only exist in that configuration.
Optionally we can put #[cfg(not(no_global_oom_handling))] on STATIC_INNER_SLICE too, and the debug-asserts in Drop, but it doesn't really hurt without.
dtolnay
approved these changes
May 19, 2024
Member
|
@bors r+ |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 20, 2024
Use a single static for all default slice Arcs. Also adds debug_asserts in Drop for Weak/Arc that the shared static is not being "dropped"/"deallocated". As per rust-lang#124640 (review) r? dtolnay
fmease
added a commit
to fmease/rust
that referenced
this pull request
May 20, 2024
Use a single static for all default slice Arcs. Also adds debug_asserts in Drop for Weak/Arc that the shared static is not being "dropped"/"deallocated". As per rust-lang#124640 (review) r? dtolnay
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 20, 2024
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#125219 (Update `unexpected_cfgs` lint for Cargo new `check-cfg` config) - rust-lang#125255 (Make `EvalCtxt` generic over `InferCtxtLike`) - rust-lang#125283 (Use a single static for all default slice Arcs.) - rust-lang#125300 (rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`) - rust-lang#125309 (Fix `tests/debuginfo/strings-and-strs`.) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 20, 2024
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#125255 (Make `EvalCtxt` generic over `InferCtxtLike`) - rust-lang#125283 (Use a single static for all default slice Arcs.) - rust-lang#125300 (rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`) - rust-lang#125309 (Fix `tests/debuginfo/strings-and-strs`.) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 20, 2024
Rollup merge of rust-lang#125283 - zachs18:arc-default-shared, r=dtolnay Use a single static for all default slice Arcs. Also adds debug_asserts in Drop for Weak/Arc that the shared static is not being "dropped"/"deallocated". As per rust-lang#124640 (review) r? dtolnay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also adds debug_asserts in Drop for Weak/Arc that the shared static is not being "dropped"/"deallocated".
As per #124640 (review)
r? dtolnay