Commit Graph

2 Commits

Author SHA1 Message Date
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
edef 52c0c92cd8 move OS specifics into sys 2015-04-16 05:49:34 -04:00