namespace factor {
namespace atomic {
+FACTOR_FORCE_INLINE static bool load(volatile bool* ptr) {
+ atomic::fence();
+ return *ptr;
+}
FACTOR_FORCE_INLINE static cell load(volatile cell* ptr) {
atomic::fence();
return *ptr;
return *ptr;
}
+FACTOR_FORCE_INLINE static void store(volatile bool* ptr, bool val) {
+ *ptr = val;
+ atomic::fence();
+}
+
FACTOR_FORCE_INLINE static void store(volatile cell* ptr, cell val) {
*ptr = val;
atomic::fence();
}
void factor_vm::set_sampling_profiler(fixnum rate) {
- bool running_p = (atomic::load(&sampling_profiler_p) != 0);
+ bool running_p = atomic::load(&sampling_profiler_p);
if (rate > 0 && !running_p)
start_sampling_profiler(rate);
else if (rate == 0 && running_p)
cell signal_handler_addr;
// are we handling a memory error? used to detect double faults
- cell faulting_p;
+ bool faulting_p;
// Various special objects, accessed by special-object and
// set-special-object primitives
c_to_factor_func_type c_to_factor_func;
// Is profiling enabled?
- volatile cell sampling_profiler_p;
+ volatile bool sampling_profiler_p;
fixnum samples_per_second;
// Global variables used to pass fault handler state from signal handler
// Only set if we're performing a GC
gc_state* current_gc;
- volatile cell current_gc_p;
+ volatile bool current_gc_p;
// Set if we're in the jit
volatile fixnum current_jit_count;
static bool fatal_erroring_p;
// Two fep_p variants, one might be redundant.
- volatile cell safepoint_fep_p;
+ volatile bool safepoint_fep_p;
// Allow Ctrl-Break a busy loop in the Listener, only used on Windows
volatile bool stop_on_ctrl_break;