about summary refs log tree commit diff
path: root/library/std/src/sys/hermit
AgeCommit message (Collapse)AuthorLines
2021-03-24Rollup merge of #83353 - m-ou-se:io-error-avoid-alloc, r=nagisaDylan DPC-78/+95
Add internal io::Error::new_const to avoid allocations. This makes it possible to have a io::Error containing a message with zero allocations, and uses that everywhere to avoid the *three* allocations involved in `io::Error::new(kind, "message")`. The function signature isn't perfect, because it needs a reference to the `&str`. So for now, this is just a `pub(crate)` function. Later, we'll be able to use `fn new_const<MSG: &'static str>(kind: ErrorKind)` to make that a bit better. (Then we'll also be able to use some ZST trickery if that would result in more efficient code.) See https://github.com/rust-lang/rust/issues/83352
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-78/+95
2021-02-24Reuse `std::sys::unsupported::pipe` on `hermit`Christiaan Dirkx-38/+1
2021-01-13deprecate atomic::spin_loop_hint in favour of hint::spin_loopAshley Mannix-2/+3
2020-11-14Disambiguate symlink argument namesDavid Tolnay-2/+2
2020-11-07Rollup merge of #74979 - maekawatoshiki:fix, r=Mark-SimulacrumYuki Okushi-0/+2
`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit Partial fix of #73904. This encloses ``unsafe`` operations in ``unsafe fn`` in ``sys/hermit``. Some unsafe blocks are not well documented because some system-based functions lack documents.
2020-10-13box mutex to get a movable mutexStefan Lankes-1/+1
the commit avoid an alignement issue in Mutex implementation
2020-10-12define required type 'MovableMutex'Stefan Lankes-0/+2
2020-10-12reuse implementation of the system provider "unsupported"Stefan Lankes-0/+1
2020-10-12remove obsolete function divergeStefan Lankes-153/+0
2020-10-11revise code to pass the format checkStefan Lankes-3/+3
2020-10-11fix typos in new methodStefan Lankes-1/+5
2020-10-11revise comments and descriptions of the helper functionsStefan Lankes-3/+2
2020-10-11revise code to pass the format checkStefan Lankes-14/+5
2020-10-11revise Hermit's mutex interface to support the behaviour of StaticMutexStefan Lankes-8/+182
rust-lang/rust#77147 simplifies things by splitting this Mutex type into two types matching the two use cases: StaticMutex and MovableMutex. To support the behavior of StaticMutex, we move part of the mutex implementation into libstd.
2020-10-08Remove #![allow(unsafe_op_in_unsafe_fn)] except for mod.rsmaekawatoshiki-15/+0
2020-10-02Make it possible to have unboxed condvars on specific platforms.Mara Bos-0/+2
This commit keeps all condvars boxed on all platforms, but makes it trivial to remove the box on some platforms later.
2020-09-27Split sys_common::Mutex in StaticMutex and MovableMutex.Mara Bos-2/+2
The (unsafe) Mutex from sys_common had a rather complicated interface. You were supposed to call init() manually, unless you could guarantee it was neither moved nor used reentrantly. Calling `destroy()` was also optional, although it was unclear if 1) resources might be leaked or not, and 2) if destroy() should only be called when `init()` was called. This allowed for a number of interesting (confusing?) different ways to use this Mutex, all captured in a single type. In practice, this type was only ever used in two ways: 1. As a static variable. In this case, neither init() nor destroy() are called. The variable is never moved, and it is never used reentrantly. It is only ever locked using the LockGuard, never with raw_lock. 2. As a Boxed variable. In this case, both init() and destroy() are called, it will be moved and possibly used reentrantly. No other combinations are used anywhere in `std`. This change simplifies things by splitting this Mutex type into two types matching the two use cases: StaticMutex and MovableMutex. The interface of both new types is now both safer and simpler. The first one does not call nor expose init/destroy, and the second one calls those automatically in its new() and Drop functions. Also, the locking functions of MovableMutex are no longer unsafe.
2020-08-21Make raw standard stream constructors constTomasz Miąsko-3/+3
2020-08-21Remove result type from raw standard streams constructorsTomasz Miąsko-7/+7
Raw standard streams constructors are infallible. Remove unnecessary result type.
2020-08-21Add `#![allow(unsafe_op_in_unsafe_fn)]` in sys/hermitmaekawatoshiki-0/+17
2020-08-21Revert "`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit"maekawatoshiki-147/+75
This reverts commit 7cae9e8c88e468e94c157d9aaee4b8e3cf90b9a4.
2020-07-31`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermitmaekawatoshiki-75/+147
2020-07-28adjust remaining targetsStefan Lankes-2/+2
- fix commit 7dc3886 - previous commit doesn't adjust all targets
2020-07-27mv std libs to library/mark-0/+2499