]> gitweb.factorcode.org Git - factor.git/blob - vm/atomic.hpp
VM: Refactor atomic.hpp to Factor style
[factor.git] / vm / atomic.hpp
1 namespace factor {
2 namespace atomic {
3 FACTOR_FORCE_INLINE static cell load(volatile cell* ptr) {
4   atomic::fence();
5   return *ptr;
6 }
7
8 FACTOR_FORCE_INLINE static fixnum load(volatile fixnum* ptr) {
9   atomic::fence();
10   return *ptr;
11 }
12
13 FACTOR_FORCE_INLINE static void store(volatile cell* ptr, cell val) {
14   *ptr = val;
15   atomic::fence();
16 }
17
18 FACTOR_FORCE_INLINE static void store(volatile fixnum* ptr, fixnum val) {
19   *ptr = val;
20   atomic::fence();
21 }
22 }
23 }