VM: Refactor atomic.hpp to Factor style

db4
Erik Charlebois 2013-05-11 21:43:20 -04:00
parent ca1276841d
commit 6dacc44029
1 changed files with 21 additions and 25 deletions

View File

@ -1,27 +1,23 @@
namespace factor {
namespace atomic {
FACTOR_FORCE_INLINE static cell load(volatile cell *ptr)
{
atomic::fence();
return *ptr;
}
FACTOR_FORCE_INLINE static fixnum load(volatile fixnum *ptr)
{
atomic::fence();
return *ptr;
}
FACTOR_FORCE_INLINE static void store(volatile cell *ptr, cell val)
{
*ptr = val;
atomic::fence();
}
FACTOR_FORCE_INLINE static void store(volatile fixnum *ptr, fixnum val)
{
*ptr = val;
atomic::fence();
}
}
namespace atomic {
FACTOR_FORCE_INLINE static cell load(volatile cell* ptr) {
atomic::fence();
return *ptr;
}
FACTOR_FORCE_INLINE static fixnum load(volatile fixnum* ptr) {
atomic::fence();
return *ptr;
}
FACTOR_FORCE_INLINE static void store(volatile cell* ptr, cell val) {
*ptr = val;
atomic::fence();
}
FACTOR_FORCE_INLINE static void store(volatile fixnum* ptr, fixnum val) {
*ptr = val;
atomic::fence();
}
}
}