- 21 8月, 2021 3 次提交
-
-
由 bors 提交于
where available use AtomicU{64,128} instead of mutex for Instant backsliding protection This decreases the overhead of backsliding protection on x86 systems with unreliable TSC, e.g. windows. And on aarch64 systems where 128bit atomics are available. The following benchmarks were taken on x86_64 linux though by overriding `actually_monotonic()`, the numbers may look different on other platforms ``` # actually_monotonic() == true test time::tests::instant_contention_01_threads ... bench: 44 ns/iter (+/- 0) test time::tests::instant_contention_02_threads ... bench: 44 ns/iter (+/- 0) test time::tests::instant_contention_04_threads ... bench: 44 ns/iter (+/- 0) test time::tests::instant_contention_08_threads ... bench: 44 ns/iter (+/- 0) test time::tests::instant_contention_16_threads ... bench: 44 ns/iter (+/- 0) # 1x AtomicU64 test time::tests::instant_contention_01_threads ... bench: 65 ns/iter (+/- 0) test time::tests::instant_contention_02_threads ... bench: 157 ns/iter (+/- 20) test time::tests::instant_contention_04_threads ... bench: 281 ns/iter (+/- 53) test time::tests::instant_contention_08_threads ... bench: 555 ns/iter (+/- 77) test time::tests::instant_contention_16_threads ... bench: 883 ns/iter (+/- 107) # mutex test time::tests::instant_contention_01_threads ... bench: 60 ns/iter (+/- 2) test time::tests::instant_contention_02_threads ... bench: 770 ns/iter (+/- 231) test time::tests::instant_contention_04_threads ... bench: 1,347 ns/iter (+/- 45) test time::tests::instant_contention_08_threads ... bench: 2,693 ns/iter (+/- 114) test time::tests::instant_contention_16_threads ... bench: 5,244 ns/iter (+/- 487) ``` Since I don't have an arm machine with 128bit atomics I wasn't able to benchmark the AtomicU128 implementation.
-
由 The8472 提交于
-
由 bors 提交于
Reenable RemoveZsts Now that the underlying issue has been fixed by #88124, we can reland #83417. r? `@oli-obk`
-
- 20 8月, 2021 37 次提交
-
-
由 bors 提交于
clippy::perf fixes
-
由 bors 提交于
I/O safety. Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd` for relevant types, along with Windows counterparts for handles and sockets. Tracking issue: <https://github.com/rust-lang/rust/issues/87074> RFC: <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md> Highlights: - The doc comments at the top of library/std/src/os/unix/io/mod.rs and library/std/src/os/windows/io/mod.rs - The new types and traits in library/std/src/os/unix/io/fd.rs and library/std/src/os/windows/io/handle.rs - The removal of the `RawHandle` struct the Windows impl, which had the same name as the `RawHandle` type alias, and its functionality is now folded into `Handle`. Managing five levels of wrapping (File wraps sys::fs::File wraps sys::fs::FileDesc wraps OwnedFd wraps RawFd, etc.) made for a fair amount of churn and verbose as/into/from sequences in some places. I've managed to simplify some of them, but I'm open to ideas here. r? `@joshtriplett`
-
由 bors 提交于
Fix compiling other codegen backends when llvm is enabled Extracted from #81746 Without this change rustbuild will not pass the required linker argument to find libllvm. While other backends likely don't use libllvm, it is necessary to be able to link against rustc_driver as the llvm backend is linked into it.
-
由 bors 提交于
Add fast path for Path::cmp that skips over long shared prefixes ``` # before test path::tests::bench_path_cmp_fast_path_buf_sort ... bench: 60,811 ns/iter (+/- 865) test path::tests::bench_path_cmp_fast_path_long ... bench: 6,459 ns/iter (+/- 275) test path::tests::bench_path_cmp_fast_path_short ... bench: 1,777 ns/iter (+/- 34) # after test path::tests::bench_path_cmp_fast_path_buf_sort ... bench: 38,140 ns/iter (+/- 211) test path::tests::bench_path_cmp_fast_path_long ... bench: 1,471 ns/iter (+/- 24) test path::tests::bench_path_cmp_fast_path_short ... bench: 1,106 ns/iter (+/- 9) ```
-
由 Erik Desjardins 提交于
This reverts commit 8e11199a.
-
由 bors 提交于
RFC2229 Only compute place if upvars can be resolved Closes https://github.com/rust-lang/rust/issues/87987 This PR fixes an ICE when trying to unwrap an Err. This error appears when trying to convert a PlaceBuilder into Place when upvars can't yet be resolved. We should only try to convert a PlaceBuilder into Place if upvars can be resolved. r? `@nikomatsakis`
-
由 bors 提交于
RFC2229 Add missing edge case Closes https://github.com/rust-lang/rust/issues/87988 This PR fixes an ICE where a match discriminant is not being read when expected. This ICE was the result of a missing edge case which assumed that if a pattern is of type `PatKind::TupleStruct(..) | PatKind::Path(..) | PatKind::Struct(..) | PatKind::Tuple(..)` then a place could only be a multi variant if the place is of type kind Adt.
-
由 Dan Gohman 提交于
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #86123 (Preserve more spans in internal `rustc_queries!` macro) - #87874 (Add TcpStream type to TcpListener::incoming docs) - #88034 (rustc_privacy: Replace `HirId`s and `DefId`s with `LocalDefId`s where possible) - #88050 (Remove `HashStable` impls for `FileName` and `RealFileName`) - #88093 ([rustdoc] Wrap code blocks in `<code>` tag) - #88146 (Add tests for some `feature(const_evaluatable_checked)` incr comp issues) - #88153 (Update .mailmap) - #88159 (Use a trait instead of the now disallowed missing trait there) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
Use `into_raw_handle()` rather than `into_inner()` to completely consume a `Handle` without dropping its contained handle.
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
The name (and updated documentation) make the FFI-only usage clearer, and wrapping Option<OwnedHandle> avoids the need to write a separate Drop or Debug impl. Co-authored-by: NJosh Triplett <josh@joshtriplett.org>
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
`mmap` doesn't *always* cause undefined behavior; it depends on the details of how you use it.
-
由 Dan Gohman 提交于
-
由 Dan Gohman 提交于
Co-authored-by: NJosh Triplett <josh@joshtriplett.org>
-
由 Dan Gohman 提交于
Co-authored-by: NJosh Triplett <josh@joshtriplett.org>
-
由 Dan Gohman 提交于
Co-authored-by: NJosh Triplett <josh@joshtriplett.org>
-
由 Dan Gohman 提交于
Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd` for relevant types, along with Windows counterparts for handles and sockets. Tracking issue: - <https://github.com/rust-lang/rust/issues/87074> RFC: - <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>
-
由 Guillaume Gomez 提交于
Use a trait instead of the now disallowed missing trait there To properly test the unused generic parameter and just that we need to use a trait in the tait. Missing the trait there is already tested and is not what we meant to test here. r? `@oli-obk`
-