]> gitweb.factorcode.org Git - factor.git/blob - vm/atomic.hpp
io.streams.256color: faster by caching styles
[factor.git] / vm / atomic.hpp
1 namespace factor {
2 namespace atomic {
3 FACTOR_FORCE_INLINE static bool load(volatile bool* ptr) {
4   atomic::fence();
5   return *ptr;
6 }
7 FACTOR_FORCE_INLINE static cell load(volatile cell* ptr) {
8   atomic::fence();
9   return *ptr;
10 }
11
12 FACTOR_FORCE_INLINE static fixnum load(volatile fixnum* ptr) {
13   atomic::fence();
14   return *ptr;
15 }
16
17 FACTOR_FORCE_INLINE static void store(volatile bool* ptr, bool val) {
18   *ptr = val;
19   atomic::fence();
20 }
21
22 FACTOR_FORCE_INLINE static void store(volatile cell* ptr, cell val) {
23   *ptr = val;
24   atomic::fence();
25 }
26
27 FACTOR_FORCE_INLINE static void store(volatile fixnum* ptr, fixnum val) {
28   *ptr = val;
29   atomic::fence();
30 }
31 }
32 }