mirror of
https://github.com/CPunch/Cosmo.git
synced 2025-12-23 02:40:05 +00:00
cosmoV_throw() now resets the vm stack as well
also a minor GC bug in cosmoO_newError was fixed. i'm going to try to phase out cosmoM_freezeGC & friends since that would cause hell with this new error handling solution. the only thing still using it is the GC.
This commit is contained in:
@@ -948,16 +948,9 @@ int cosmoB_vnewindexBProto(CState *state, int nargs, CValue *args)
|
||||
// vm.collect()
|
||||
int cosmoB_vcollect(CState *state, int nargs, CValue *args)
|
||||
{
|
||||
// first, unfreeze the state (we start frozen on entry to any C Function)
|
||||
cosmoM_unfreezeGC(state);
|
||||
|
||||
// now force a garbage collection
|
||||
cosmoM_collectGarbage(state);
|
||||
|
||||
// and re-freeze the state
|
||||
cosmoM_freezeGC(state);
|
||||
|
||||
// the end!
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user