refactoring and cleanup

cosmoB_loadOSLib -> cosmoB_loadOS
This commit is contained in:
2023-08-24 23:36:32 -05:00
committed by cpunch
parent 155e0829fb
commit f76f2ffa92
10 changed files with 46 additions and 64 deletions

View File

@@ -49,9 +49,10 @@ int addConstant(CState *state, CChunk *chunk, CValue value)
return i; // we already have a matching constant!
}
cosmoM_freezeGC(state); // so our GC doesn't free it
cosmoV_pushValue(state, value); // push the value to the stack so our GC can see it
appendValArray(state, &chunk->constants, value);
cosmoM_unfreezeGC(state);
cosmoV_pop(state);
return chunk->constants.count - 1; // return the index of the new constants
}