rust/src
Stepan Koltsov f853cf79b5 Optimize common path of Once::doit
Optimize `Once::doit`: perform optimistic check that initializtion is
already completed.  `load` is much cheaper than `fetch_add` at least
on x86_64.

Verified with this test:

```
static mut o: one::Once = one::ONCE_INIT;
unsafe {
    loop {
        let start = time::precise_time_ns();
        let iters = 50000000u64;
        for _ in range(0, iters) {
            o.doit(|| { println!("once!"); });
        }
        let end = time::precise_time_ns();
        let ps_per_iter = 1000 * (end - start) / iters;
        println!("{} ps per iter", ps_per_iter);

        // confuse the optimizer
        o.doit(|| { println!("once!"); });
    }
}
```

Test executed on Mac, Intel Core i7 2GHz. Result is:
* 20ns per iteration without patch
*  4ns per iteration with this patch applied

Once.doit could be even faster (800ps per iteration), if `doit` function
was split into a pair of `doit`/`doit_slow`, and `doit` marked as
`#[inline]` like this:

```
#[inline(always)]
pub fn doit(&self, f: ||) {
    if self.cnt.load(atomics::SeqCst) < 0 {
        return
    }

    self.doit_slow(f);
}

fn doit_slow(&self, f: ||) { ... }
```
2014-05-14 10:23:42 +00:00
..
compiler-rt@ed112ca1e4 Upgrade compiler-rt 2014-04-22 15:50:51 -07:00
compiletest io: Implement process wait timeouts 2014-05-13 17:27:42 -07:00
doc add a line to the example to clarify semantics 2014-05-13 17:24:08 -07:00
driver Snapshot cleanup 2014-03-23 09:45:13 -07:00
etc std: Rename str::Normalizations to str::Decompositions 2014-05-13 17:24:07 -07:00
gyp@1e46da1000 Update bundled gyp 2013-12-28 10:42:25 -08:00
jemalloc@6a96910f2e add back jemalloc to the tree 2014-05-10 19:58:17 -04:00
libarena Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libbacktrace Bundle libbacktrace with the compiler 2014-03-11 21:02:34 -07:00
libcollections Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libcore core: Allow using failure outside of libcore 2014-05-13 23:59:03 -07:00
libflate Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libfmt_macros Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libfourcc Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libgetopts Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libglob Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libgraphviz Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libgreen Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libhexfloat Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
liblibc io: Implement process wait timeouts 2014-05-13 17:27:42 -07:00
liblog Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libnative io: Implement process wait timeouts 2014-05-13 17:27:42 -07:00
libnum Implements Default trait for BigInt and BigUint 2014-05-13 17:24:07 -07:00
librand io: Add .read_at_least() to Reader 2014-05-13 18:45:20 -07:00
libregex Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libregex_macros Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
librustc io: Implement process wait timeouts 2014-05-13 17:27:42 -07:00
librustdoc Touch up and rebase previous commits 2014-05-13 17:24:08 -07:00
librustuv io: Implement process wait timeouts 2014-05-13 17:27:42 -07:00
libsemver Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libserialize serialize: Broaden ignores of json tests 2014-05-13 09:28:26 -07:00
libstd core: Inherit the atomics module 2014-05-13 23:59:03 -07:00
libsync Optimize common path of Once::doit 2014-05-14 10:23:42 +00:00
libsyntax syntax: Improve --pretty normal slightly 2014-05-13 17:24:08 -07:00
libterm Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libtest Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libtime Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
liburl Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libuuid Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
libuv@43495892de Update libuv 2014-04-24 09:08:07 -07:00
libworkcache Add the patch number to version strings. Closes #13289 2014-05-12 19:52:29 -07:00
llvm@4b4d0533b4 Upgrade LLVM 2014-04-17 11:11:39 -07:00
rt make sure jemalloc valgrind support is enabled 2014-05-11 20:05:22 -04:00
rustllvm rustllvm: Add LLVMRustArrayType 2014-05-13 17:24:08 -07:00
test io: Implement process wait timeouts 2014-05-13 17:27:42 -07:00
README.md Add a regex crate to the Rust distribution. 2014-04-25 00:27:24 -04:00
snapshots.txt register snapshots 2014-05-12 02:52:32 -04:00

This is a preliminary version of the Rust compiler, libraries and tools.

Source layout:

Path Description
librustc/ The self-hosted compiler
libstd/ The standard library (imported and linked by default)
libextra/ The "extras" library (slightly more peripheral code)
libgreen/ The M:N runtime library
libnative/ The 1:1 runtime library
libsyntax/ The Rust parser and pretty-printer
libcollections/ A collection of useful data structures and containers
libnum/ Extended number support library (complex, rational, etc)
libtest/ Rust's test-runner code
------------------- ---------------------------------------------------------
libarena/ The arena (a fast but limited) memory allocator
libflate/ Simple compression library
libfourcc/ Data format identifier library
libgetopts/ Get command-line-options library
libglob/ Unix glob patterns library
libregex/ Regular expressions
libsemver/ Rust's semantic versioning library
libserialize/ Encode-Decode types library
libsync/ Concurrency mechanisms and primitives
libterm/ ANSI color library for terminals
libtime/ Time operations library
libuuid/ UUID's handling code
------------------- ---------------------------------------------------------
rt/ The runtime system
rt/rust_*.c - Some of the runtime services
rt/vg - Valgrind headers
rt/msvc - MSVC support
rt/sundown - The Markdown library used by rustdoc
------------------- ---------------------------------------------------------
compiletest/ The test runner
test/ Testsuite
test/codegen - Tests for the LLVM IR infrastructure
test/compile-fail - Tests that should fail to compile
test/debug-info - Tests for the debuginfo tool
test/run-fail - Tests that should compile, run and fail
test/run-make - Tests that depend on a Makefile infrastructure
test/run-pass - Tests that should compile, run and succeed
test/bench - Benchmarks and miscellaneous
test/pretty - Pretty-printer tests
test/auxiliary - Dependencies of tests
------------------- ---------------------------------------------------------
librustdoc/ The Rust API documentation tool
libuv/ The libuv submodule
librustuv/ Rust libuv support code
------------------- ---------------------------------------------------------
llvm/ The LLVM submodule
rustllvm/ LLVM support code
------------------- ---------------------------------------------------------
etc/ Scripts, editors support, misc

NOTE: This list (especially the second part of the table which contains modules and libraries) is highly volatile and subject to change.