mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-02-02 09:00:03 +00:00
refactored cosmoV_set & cosmoV_get, renamed COSMO_TOBJ->COSMO_TREF
also changed print() to print raw primitives instead of generating a <string> needlessly. helped performance immensely in scripts like `examples/increment.cosmo`
This commit is contained in:
@@ -71,7 +71,7 @@ void tableRemoveWhite(CState *state, CTable *tbl) {
|
||||
int cap = tbl->capacityMask + 1;
|
||||
for (int i = 0; i < cap; i++) {
|
||||
CTableEntry *entry = &tbl->table[i];
|
||||
if (IS_OBJ(entry->key) && !(cosmoV_readRef(entry->key))->isMarked) { // if the key is a object and it's white (unmarked), remove it from the table
|
||||
if (IS_REF(entry->key) && !(cosmoV_readRef(entry->key))->isMarked) { // if the key is a object and it's white (unmarked), remove it from the table
|
||||
cosmoT_remove(state, tbl, entry->key);
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void markObject(CState *state, CObj *obj) {
|
||||
}
|
||||
|
||||
void markValue(CState *state, CValue val) {
|
||||
if (IS_OBJ(val))
|
||||
if (IS_REF(val))
|
||||
markObject(state, cosmoV_readRef(val));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user