vm: change some bools from cell to bool.

master
John Benediktsson 2020-08-14 10:27:18 -07:00
parent 0c0647f12c
commit f21deee3df
3 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,9 @@
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;
@ -10,6 +14,11 @@ FACTOR_FORCE_INLINE static fixnum load(volatile fixnum* 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();

View File

@ -93,7 +93,7 @@ void factor_vm::record_sample(bool prolog_p) {
}
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)

View File

@ -35,7 +35,7 @@ struct factor_vm {
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
@ -70,7 +70,7 @@ struct factor_vm {
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
@ -102,7 +102,7 @@ struct factor_vm {
// 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;
@ -146,7 +146,7 @@ struct factor_vm {
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;