Skip to content

New zeroed slice - #75171

Merged
bors merged 3 commits into
rust-lang:masterfrom
amosonn:new_zeroed_slice
Aug 22, 2020
Merged

New zeroed slice#75171
bors merged 3 commits into
rust-lang:masterfrom
amosonn:new_zeroed_slice

Conversation

@amosonn

Copy link
Copy Markdown
Contributor

Add to #63291 the methods

impl<T>Box<[T]>{pubfnnew_zeroed_slice(len:usize) -> Box<[MaybeUninit<T>]>{}}impl<T>Rc<[T]>{pubfnnew_zeroed_slice(len:usize) -> Rc<[MaybeUninit<T>]>{}}impl<T>Arc<[T]>{pubfnnew_zeroed_slice(len:usize) -> Arc<[MaybeUninit<T>]>{}}

as suggested in #63291 (comment) .

Also optimize {Rc, Arc}::new_zeroed to use alloc_zeroed, otherwise they are no more efficient than using new_uninit and zeroing the memory manually (which was the original implementation).

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 5, 2020
@amosonn

Copy link
Copy Markdown
ContributorAuthor

r? @SimonSapin

@bors

bors commented Aug 5, 2020

Copy link
Copy Markdown
Collaborator

@amosonn: 🔑 Insufficient privileges: not in try users

1 similar comment
@bors

bors commented Aug 5, 2020

Copy link
Copy Markdown
Collaborator

@amosonn: 🔑 Insufficient privileges: not in try users

@amosonn
amosonnforce-pushed the new_zeroed_slice branch 3 times, most recently from b2eebb5 to f75f492CompareAugust 5, 2020 03:49
@bors

bors commented Aug 5, 2020

Copy link
Copy Markdown
Collaborator

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

@amosonn
amosonnforce-pushed the new_zeroed_slice branch 2 times, most recently from a41071d to ab204c5CompareAugust 5, 2020 06:31
@crlf0710crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2020
@Dylan-DPC-zz

Copy link
Copy Markdown

r? @Amanieu

Comment threadlibrary/alloc/src/rc.rs Outdated
@Amanieu

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion

@bors

bors commented Aug 21, 2020

Copy link
Copy Markdown
Collaborator

⌛ Trying commit ab204c5 with merge c7bc9915d37800e60ddf1d2cc573758c724395c3...

@Amanieu

Copy link
Copy Markdown
Member

@bors try

@bors

bors commented Aug 21, 2020

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 5aba816 with merge f3a9871a4972d9c4fe07f70e3e5aa63d6bdb6577...

@bors

bors commented Aug 21, 2020

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions, checks-azure
Build commit: f3a9871a4972d9c4fe07f70e3e5aa63d6bdb6577 (f3a9871a4972d9c4fe07f70e3e5aa63d6bdb6577)

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued f3a9871a4972d9c4fe07f70e3e5aa63d6bdb6577 with parent de521cb, future comparison URL.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking try commit (f3a9871a4972d9c4fe07f70e3e5aa63d6bdb6577): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never

@Amanieu

Copy link
Copy Markdown
Member

@bors r+ rollup-

@bors

bors commented Aug 22, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 5aba816 has been approved by Amanieu

@borsbors 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 Aug 22, 2020
@bors

bors commented Aug 22, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 5aba816 with merge 663d2f5...

@bors

bors commented Aug 22, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions, checks-azure
Approved by: Amanieu
Pushing 663d2f5 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Aug 22, 2020
@bors
bors merged commit 663d2f5 into rust-lang:masterAug 22, 2020
@cuvipercuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@amosonn@rust-highfive@bors@Dylan-DPC-zz@Amanieu@rust-timer@cuviper@SimonSapin@crlf0710@sfackler