rust/library/std
Mara Bos 07fd17f701 Only use LOCAL_{STDOUT,STDERR} when set_{print/panic} is used.
The thread local LOCAL_STDOUT and LOCAL_STDERR are only used by the test
crate to capture output from tests when running them in the same process
in differen threads. However, every program will check these variables
on every print, even outside of testing.

This involves allocating a thread local key, and registering a thread
local destructor. This can be somewhat expensive.

This change keeps a global flag (LOCAL_STREAMS) which will be set to
true when either of these local streams is used. (So, effectively only
in test and benchmark runs.) When this flag is off, these thread locals
are not even looked at and therefore will not be initialized on the
first output on every thread, which also means no thread local
destructors will be registered.
2020-09-27 16:04:25 +02:00
..
benches
src Only use LOCAL_{STDOUT,STDERR} when set_{print/panic} is used. 2020-09-27 16:04:25 +02:00
tests
build.rs Remove duplicated library links between std and libc 2020-09-21 01:37:15 -07:00
Cargo.toml Use IOV_MAX and UIO_MAXIOV constants in limit vectored I/O 2020-09-10 16:27:28 +02:00