A Rust library implementing safe, lightweight context switches, without relying on kernel services
Go to file
edef cbc10fd311 cache page_size
page_size is used in every nearly every pointer calculation in os.rs,
and the Stack methods are called fairly often. It's definitely not worth
spilling registers for to call out to a libc function.
With this change, page_size becomes effectively free. It is cached in an
atomic usize, with relaxed ordering, so no actual atomic operations are
involved.

Benchmark:
```
test bench_page_size        ... bench:         5 ns/iter (+/- 1)
test bench_page_size_cached ... bench:         0 ns/iter (+/- 0)
```
2015-04-16 05:52:56 -04:00
benches return a Result from StackSource::get_stack with an associated Error 2015-04-16 04:14:18 -04:00
examples return a Result from StackSource::get_stack with an associated Error 2015-04-16 04:14:18 -04:00
src cache page_size 2015-04-16 05:52:56 -04:00
.editorconfig add .editorconfig 2015-04-16 04:17:55 -04:00
.gitignore initial commit 2014-12-23 04:27:28 +01:00
Cargo.toml make Valgrind optional 2015-04-16 03:22:57 -04:00
LICENSE include valgrind.h, so we don't depend on Valgrind at build time 2015-04-16 04:32:56 -04:00
build.rs make Valgrind optional 2015-04-16 03:22:57 -04:00