organized flags

This commit is contained in:
CPunch 2021-01-04 16:20:05 -06:00
parent 752bd533e9
commit ec3552a155
4 changed files with 12 additions and 12 deletions

View File

@ -26,7 +26,7 @@
cosmoM_reallocate(state, x, sizeof(type), 0)
#define cosmoM_isFrozen(state) \
state->freezeGC > 0
(state->freezeGC > 0)
// if debugging, print the locations of when the state is frozen/unfrozen
#ifdef GC_DEBUG

View File

@ -9,6 +9,13 @@
#include <assert.h>
/*
SAFE_STACK:
if undefined, the stack will not be checked for stack overflows. This may improve performance, however
this will produce undefined behavior as you reach the stack limit (and may cause a seg fault!). It is recommended to keep this enabled.
*/
#define SAFE_STACK
//#define NAN_BOXXED
#define COSMOASSERT(x) assert(x)

View File

@ -45,10 +45,10 @@ typedef union CValue {
#define GET_TYPE(x) \
((((x).data & MASK_QUIETNAN) == MASK_QUIETNAN) ? (((x).data & MASK_TYPE) >> 48) : COSMO_TNUMBER)
static const uint64_t SIG_MASK = (MASK_QUIETNAN | MASK_TYPE);
static const uint64_t BOOL_SIG = (MASK_QUIETNAN | ((uint64_t)(COSMO_TBOOLEAN) << 48));
static const uint64_t OBJ_SIG = (MASK_QUIETNAN | ((uint64_t)(COSMO_TOBJ) << 48));
static const uint64_t NIL_SIG = (MASK_QUIETNAN | ((uint64_t)(COSMO_TNIL) << 48));
#define SIG_MASK (MASK_QUIETNAN | MASK_TYPE)
#define BOOL_SIG (MASK_QUIETNAN | ((uint64_t)(COSMO_TBOOLEAN) << 48))
#define OBJ_SIG (MASK_QUIETNAN | ((uint64_t)(COSMO_TOBJ) << 48))
#define NIL_SIG (MASK_QUIETNAN | ((uint64_t)(COSMO_TNIL) << 48))
#define cosmoV_newNumber(x) ((CValue){.num = x})
#define cosmoV_newBoolean(x) ((CValue){.data = MAKE_PAYLOAD(x) | BOOL_SIG})

View File

@ -6,13 +6,6 @@
#include "cosmo.h"
#include "cstate.h"
/*
SAFE_STACK:
if undefined, the stack will not be checked for stack overflows. This may improve performance, however
this will produce undefined behavior as you reach the stack limit (and may cause a seg fault!). It is recommended to keep this enabled.
*/
#define SAFE_STACK
typedef enum {
COSMOVM_OK,
COSMOVM_RUNTIME_ERR,