| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Enable some timeouts in SGX platform
This would partially resolve https://github.com/fortanix/rust-sgx/issues/31
cc @jethrogb and @Goirad
|
|
Slight reorganization of sys/(fast_)thread_local
I was long confused by the `thread_local` and `fast_thread_local` modules in the `sys(_common)` part of libstd. The names make it *sound* like `fast_thread_local` is just a faster version of `thread_local`, but really these are totally different APIs: one provides thread-local "keys", which are non-addressable pointer-sized pieces of local storage with an associated destructor; the other (the "fast" one) provides just a destructor.
So I propose we rename `fast_thread_local` to `thread_local_dtor`, and `thread_local` to `thread_local_key`. That's what this PR does.
|
|
|
|
|
|
This would partially resolve
https://github.com/fortanix/rust-sgx/issues/31
|
|
|
|
|
|
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
|
|
Lint must_use on mem::replace
This adds a hint on `mem::replace`, "if you don't need the old value,
you can just assign the new value directly". This is in similar spirit
to the `must_use` on `ManuallyDrop::take`.
|
|
|
|
|
|
|
|
As discussed in #67939, this allows turning Option<ThreadId> into Option<NonZeroU64> which
can then be stored inside an AtomicU64.
|
|
We see multiple cases inside rustc and ecosystem code where ThreadId is
transmuted to u64, exploiting the underlying detail. This is suboptimal
(can break unexpectedly if we change things in std).
It is unlikely that ThreadId will ever need to be larger than u64 --
creating even 2^32 threads over the course of a program is quite hard,
2^64 is even harder. As such, we do not choose to return a larger sized
type (e.g. u128). If we choose to shrink ThreadId in the future, or
otherwise change its internals, it is likely that a mapping to u64 will
still be applicable (though may become more complex).
|
|
|
|
|
|
This commit applies rustfmt with rust-lang/rust's default settings to
files in src/libstd *that are not involved in any currently open PR* to
minimize merge conflicts. THe list of files involved in open PRs was
determined by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8
With the list of files from the script in outstanding_files, the
relevant commands were:
$ find src/libstd -name '*.rs' \
| xargs rustfmt --edition=2018 --unstable-features --skip-children
$ rg libstd outstanding_files | xargs git checkout --
Repeating this process several months apart should get us coverage of
most of the rest of libstd.
To confirm no funny business:
$ git checkout $THIS_COMMIT^
$ git show --pretty= --name-only $THIS_COMMIT \
| xargs rustfmt --edition=2018 --unstable-features --skip-children
$ git diff $THIS_COMMIT # there should be no difference
|
|
Remove unused parameters in `__thread_local_inner`
Fixes #65993.
|
|
|
|
Removed parameters not used in the macro
|
|
|
|
|
|
|
|
|
|
std: Reduce checks for `feature = "backtrace"`
This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
|
|
This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
|
|
|
|
(TLS is usually understood as Transport Layer Security
outside rust-std internals)
|
|
Add a few trait impls for AccessError
|
|
|
|
|
|
|
|
macos tlv workaround
fixes: #60141
Includes:
* remove dead code: `requires_move_before_drop`. This hasn't been needed for a while now (oops I should have removed it in #57655)
* redox had a copy of `fast::Key` (not sure why?). That has been removed.
* Perform a `read_volatile` on OSX to reduce `tlv_get_addr` calls per `__getit` from (4-2 depending on context) to 1.
`tlv_get_addr` is relatively expensive (~1.5ns on my machine).
Previously, in contexts where `__getit` was inlined, 4 calls to `tlv_get_addr` were performed per lookup. For some reason when `__getit` is not inlined this is reduced to 2x - and performance improves to match.
After this PR, I have only ever seen 1x call to `tlv_get_addr` per `__getit`, and macos now benefits from situations where `__getit` is inlined.
I'm not sure if the `read_volatile(&&__KEY)` trick is working around an LLVM bug, or a rustc bug, or neither.
r? @alexcrichton
|
|
|
|
|
|
|
|
|
|
- add comment explaining that the fast::Key data structure was carefully constructed for fast access on OSX
- remove inline(never) from the initializer for types where `needs_drop::<T>()` is false
|
|
|
|
|
|
This reverts commit d252f3b77f3b7d4cd59620588f9d026633c05816.
|
|
|
|
|
|
|
|
Stack size of 10 **bytes** does not make any sense: the minimal possible stack size is greater anyway.
|
|
|
|
|
|
Include id in Thread's Debug implementation
Since Rust 1.19.0, `id` is a stable method, so there is no reason to not include it in Debug implementation.
|
|
Since Rust 1.19.0, id is a stable method, so there is no reason to
not include it in Debug implementation.
|