mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-24 08:01:05 +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) {
|
void blackenObject(CState *state, CObj *obj) {
|
||||||
switch (obj->type) {
|
switch (obj->type) {
|
||||||
case COBJ_STRING:
|
case COBJ_STRING:
|
||||||
case COBJ_OBJECT: // TODO: when metatables are added, make sure they're marked
|
|
||||||
case COBJ_CFUNCTION:
|
case COBJ_CFUNCTION:
|
||||||
// stubbed
|
// stubbed
|
||||||
break;
|
break;
|
||||||
|
case COBJ_OBJECT: {
|
||||||
|
// mark everything this object is keeping track of
|
||||||
|
markTable(state, &((CObjObject*)obj)->tbl);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case COBJ_UPVALUE: {
|
case COBJ_UPVALUE: {
|
||||||
markValue(state, ((CObjUpval*)obj)->closed);
|
markValue(state, ((CObjUpval*)obj)->closed);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user