mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-06-24 10:30:02 +00:00
refactoring and cleanup
cosmoB_loadOSLib -> cosmoB_loadOS
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user