mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-22 07:20:05 +00:00
fix vm.collect()
we don't freeze the vm on entry to C functions now
This commit is contained in:
parent
1d2ba217af
commit
409937c1fa
@ -948,16 +948,8 @@ int cosmoB_vnewindexBProto(CState *state, int nargs, CValue *args)
|
|||||||
// vm.collect()
|
// vm.collect()
|
||||||
int cosmoB_vcollect(CState *state, int nargs, CValue *args)
|
int cosmoB_vcollect(CState *state, int nargs, CValue *args)
|
||||||
{
|
{
|
||||||
// first, unfreeze the state (we start frozen on entry to any C Function)
|
// force a garbage collection
|
||||||
cosmoM_unfreezeGC(state);
|
|
||||||
|
|
||||||
// now force a garbage collection
|
|
||||||
cosmoM_collectGarbage(state);
|
cosmoM_collectGarbage(state);
|
||||||
|
|
||||||
// and re-freeze the state
|
|
||||||
cosmoM_freezeGC(state);
|
|
||||||
|
|
||||||
// the end!
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user