mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 00:00:10 +00:00
marked objects in GC
This commit is contained in:
parent
185380b2c0
commit
64c6914748
@ -80,10 +80,14 @@ void markArray(CState *state, CValueArray *array) {
|
||||
void blackenObject(CState *state, CObj *obj) {
|
||||
switch (obj->type) {
|
||||
case COBJ_STRING:
|
||||
case COBJ_OBJECT: // TODO: when metatables are added, make sure they're marked
|
||||
case COBJ_CFUNCTION:
|
||||
// stubbed
|
||||
break;
|
||||
case COBJ_OBJECT: {
|
||||
// mark everything this object is keeping track of
|
||||
markTable(state, &((CObjObject*)obj)->tbl);
|
||||
break;
|
||||
}
|
||||
case COBJ_UPVALUE: {
|
||||
markValue(state, ((CObjUpval*)obj)->closed);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user