vm: change some bools from cell to bool.
parent
0c0647f12c
commit
f21deee3df
|
@ -1,5 +1,9 @@
|
||||||
namespace factor {
|
namespace factor {
|
||||||
namespace atomic {
|
namespace atomic {
|
||||||
|
FACTOR_FORCE_INLINE static bool load(volatile bool* ptr) {
|
||||||
|
atomic::fence();
|
||||||
|
return *ptr;
|
||||||
|
}
|
||||||
FACTOR_FORCE_INLINE static cell load(volatile cell* ptr) {
|
FACTOR_FORCE_INLINE static cell load(volatile cell* ptr) {
|
||||||
atomic::fence();
|
atomic::fence();
|
||||||
return *ptr;
|
return *ptr;
|
||||||
|
@ -10,6 +14,11 @@ FACTOR_FORCE_INLINE static fixnum load(volatile fixnum* ptr) {
|
||||||
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) {
|
FACTOR_FORCE_INLINE static void store(volatile cell* ptr, cell val) {
|
||||||
*ptr = val;
|
*ptr = val;
|
||||||
atomic::fence();
|
atomic::fence();
|
||||||
|
|
|
@ -93,7 +93,7 @@ void factor_vm::record_sample(bool prolog_p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void factor_vm::set_sampling_profiler(fixnum rate) {
|
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)
|
if (rate > 0 && !running_p)
|
||||||
start_sampling_profiler(rate);
|
start_sampling_profiler(rate);
|
||||||
else if (rate == 0 && running_p)
|
else if (rate == 0 && running_p)
|
||||||
|
|
|
@ -35,7 +35,7 @@ struct factor_vm {
|
||||||
cell signal_handler_addr;
|
cell signal_handler_addr;
|
||||||
|
|
||||||
// are we handling a memory error? used to detect double faults
|
// 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
|
// Various special objects, accessed by special-object and
|
||||||
// set-special-object primitives
|
// set-special-object primitives
|
||||||
|
@ -70,7 +70,7 @@ struct factor_vm {
|
||||||
c_to_factor_func_type c_to_factor_func;
|
c_to_factor_func_type c_to_factor_func;
|
||||||
|
|
||||||
// Is profiling enabled?
|
// Is profiling enabled?
|
||||||
volatile cell sampling_profiler_p;
|
volatile bool sampling_profiler_p;
|
||||||
fixnum samples_per_second;
|
fixnum samples_per_second;
|
||||||
|
|
||||||
// Global variables used to pass fault handler state from signal handler
|
// 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
|
// Only set if we're performing a GC
|
||||||
gc_state* current_gc;
|
gc_state* current_gc;
|
||||||
volatile cell current_gc_p;
|
volatile bool current_gc_p;
|
||||||
|
|
||||||
// Set if we're in the jit
|
// Set if we're in the jit
|
||||||
volatile fixnum current_jit_count;
|
volatile fixnum current_jit_count;
|
||||||
|
@ -146,7 +146,7 @@ struct factor_vm {
|
||||||
static bool fatal_erroring_p;
|
static bool fatal_erroring_p;
|
||||||
|
|
||||||
// Two fep_p variants, one might be redundant.
|
// 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
|
// Allow Ctrl-Break a busy loop in the Listener, only used on Windows
|
||||||
volatile bool stop_on_ctrl_break;
|
volatile bool stop_on_ctrl_break;
|
||||||
|
|
Loading…
Reference in New Issue