1
0
Fork 0
libfringe/src
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
..
debug include valgrind.h, so we don't depend on Valgrind at build time 2015-04-16 04:32:56 -04:00
sys cache page_size 2015-04-16 05:52:56 -04:00
arch.rs move arch::{initialize_call_frame, swap} to inherent mthods of Registers 2015-04-15 19:35:27 -04:00
context.rs loosen the lifetime bounds on Context 2015-04-16 04:01:02 -04:00
init.s improve the assembly documentation 2015-04-16 00:22:50 -04:00
lib.rs move OS specifics into sys 2015-04-16 05:49:34 -04:00
os.rs move OS specifics into sys 2015-04-16 05:49:34 -04:00
stack.rs return a Result from StackSource::get_stack with an associated Error 2015-04-16 04:14:18 -04:00
swap.s improve the assembly documentation 2015-04-16 00:22:50 -04:00