<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libstd/rt/io/stdio.rs, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2013-11-12T04:44:07+00:00</updated>
<entry>
<title>Move std::rt::io to std::io</title>
<updated>2013-11-12T04:44:07+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-11-11T06:46:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=49ee49296b65f3d807142f3326bee71dd7e13290'/>
<id>urn:sha1:49ee49296b65f3d807142f3326bee71dd7e13290</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove #[fixed_stack_segment] and #[rust_stack]</title>
<updated>2013-11-11T18:40:34+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-11-06T23:16:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff'/>
<id>urn:sha1:7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff</id>
<content type='text'>
These two attributes are no longer useful now that Rust has decided to leave
segmented stacks behind. It is assumed that the rust task's stack is always
large enough to make an FFI call (due to the stack being very large).

There's always the case of stack overflow, however, to consider. This does not
change the behavior of stack overflow in Rust. This is still normally triggered
by the __morestack function and aborts the whole process.

C stack overflow will continue to corrupt the stack, however (as it did before
this commit as well). The future improvement of a guard page at the end of every
rust stack is still unimplemented and is intended to be the mechanism through
which we attempt to detect C stack overflow.

Closes #8822
Closes #10155
</content>
</entry>
<entry>
<title>Fix usage of libuv for windows</title>
<updated>2013-11-10T20:23:57+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-11-09T19:02:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e38a89d0b0fcc3b2f5cad600d7b3a16faeb94248'/>
<id>urn:sha1:e38a89d0b0fcc3b2f5cad600d7b3a16faeb94248</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fall back from uv tty instances more aggressively</title>
<updated>2013-11-10T09:37:11+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-11-07T23:24:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b652bbc6700e36c9ad80105c89d7fc2e3afec111'/>
<id>urn:sha1:b652bbc6700e36c9ad80105c89d7fc2e3afec111</id>
<content type='text'>
It appears that uv's support for interacting with a stdio stream as a tty when
it's actually a pipe is pretty problematic. To get around this, promote a check
to see if the stream is a tty to the top of the tty constructor, and bail out
quickly if it's not identified as a tty.

Closes #10237
</content>
</entry>
<entry>
<title>Stop extra buffering when stdout isn't a tty</title>
<updated>2013-11-04T23:48:34+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-11-04T23:45:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=615444d26306ddaf62388c73ae1dc17e48b3b2e3'/>
<id>urn:sha1:615444d26306ddaf62388c73ae1dc17e48b3b2e3</id>
<content type='text'>
Right now if you're running a program with its output piped to some location and
the program decides to go awry, when you kill the program via some signal none
of the program's last 4K of output will get printed to the screen. In theory the
solution to this would be to register a signal handler as part of the runtime
which then flushes the output stream.

I believe that the current behavior is far enough from what's expected that we
shouldn't be providing this sort of "super buffering" by default when stdout
isn't attached to a tty.
</content>
</entry>
<entry>
<title>auto merge of #10119 : Kimundi/rust/option_and_generic, r=alexcrichton</title>
<updated>2013-11-01T16:36:25+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2013-11-01T16:36:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7cff3c74b8d313154379ab73f18baab57c09bd33'/>
<id>urn:sha1:7cff3c74b8d313154379ab73f18baab57c09bd33</id>
<content type='text'>
This takes the last reforms on the `Option` type and applies them to `Result` too. For that, I reordered and grouped the functions in both modules, and also did some refactorings:

- Added `as_ref` and `as_mut` adapters to `Result`.
- Renamed `Result::map_move` to `Result::map` (same for `_err` variant), deleted other map functions. 
- Made the `.expect()` methods be generic over anything you can
  fail with.
- Updated some doc comments to the line doc comment style
- Cleaned up and extended standard trait implementations on `Option` and `Result`
- Removed legacy implementations in the `option` and `result` module
</content>
</entry>
<entry>
<title>Reordered the methods in std::Option and std::Result</title>
<updated>2013-11-01T14:00:46+00:00</updated>
<author>
<name>Marvin Löbel</name>
<email>loebel.marvin@gmail.com</email>
</author>
<published>2013-10-31T22:09:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0d92c53f4a5707ee994d74d9e96995d7bac2ab13'/>
<id>urn:sha1:0d92c53f4a5707ee994d74d9e96995d7bac2ab13</id>
<content type='text'>
Cleaned up the source in a few places

Renamed `map_move` to `map`, removed other `map` methods

Added `as_ref` and `as_mut` adapters to `Result`

Added `fmt::Default` impl
</content>
</entry>
<entry>
<title>Provide a sound method of flushing stdout</title>
<updated>2013-11-01T05:09:48+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-11-01T05:09:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8f258ab532eebce705b5eb27cc8635400992ca54'/>
<id>urn:sha1:8f258ab532eebce705b5eb27cc8635400992ca54</id>
<content type='text'>
The previous method was unsound because you could very easily create two mutable
pointers which alias the same location (not sound behavior). This hides the
function which does so and then exports an explicit flush() function (with
documentation about how it works).
</content>
</entry>
<entry>
<title>Make Writer::flush a no-op default method</title>
<updated>2013-10-30T22:17:11+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-10-30T22:10:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=452e5cdf11b30e17c69805a0bfc418feebb84081'/>
<id>urn:sha1:452e5cdf11b30e17c69805a0bfc418feebb84081</id>
<content type='text'>
Closes #9126
</content>
</entry>
<entry>
<title>Cache and buffer stdout per-task for printing</title>
<updated>2013-10-25T17:31:57+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2013-10-25T00:30:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e8f72c38f4bf74e7291043917fdd0bae1404b407'/>
<id>urn:sha1:e8f72c38f4bf74e7291043917fdd0bae1404b407</id>
<content type='text'>
Almost all languages provide some form of buffering of the stdout stream, and
this commit adds this feature for rust. A handle to stdout is lazily initialized
in the Task structure as a buffered owned Writer trait object. The buffer
behavior depends on where stdout is directed to. Like C, this line-buffers the
stream when the output goes to a terminal (flushes on newlines), and also like C
this uses a fixed-size buffer when output is not directed at a terminal.

We may decide the fixed-size buffering is overkill, but it certainly does reduce
write syscall counts when piping output elsewhere. This is a *huge* benefit to
any code using logging macros or the printing macros. Formatting emits calls to
`write` very frequently, and to have each of them backed by a write syscall was
very expensive.

In a local benchmark of printing 10000 lines of "what" to stdout, I got the
following timings:

  when |  terminal   |  redirected
----------------------------------
before |  0.575s     |   0.525s
after  |  0.197s     |   0.013s
  C    |  0.019s     |   0.004s

I can also confirm that we're buffering the output appropriately in both
situtations. We're still far slower than C, but I believe much of that has to do
with the "homing" that all tasks due, we're still performing an order of
magnitude more write syscalls than C does.
</content>
</entry>
</feed>
