Skip to content

Commit

Permalink
fix cosmoB_loadObjLib()
Browse files Browse the repository at this point in the history
- wrong # of pairs passed to cosmoV_makeTable
- minor refactoring of cmem.c:sweep()
  • Loading branch information
CPunch committed Dec 26, 2023
1 parent 5296495 commit 39060a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cbaselib.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ COSMO_API void cosmoB_loadObjLib(CState *state)
cosmoV_pushString(state, "__proto"); // key
cosmoV_pushCFunction(state, cosmoB_ogetProto); // value

cosmoV_makeTable(state, 2);
cosmoV_makeTable(state, 1);

// make __setter table
cosmoV_pushString(state, "__setter");
Expand Down
6 changes: 3 additions & 3 deletions src/cmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ static void traceGrays(CState *state)

static void sweep(CState *state)
{
CObj *prev = NULL;
CObj *object = state->objects;
CObj *prev = NULL, *object = state->objects;

while (object != NULL) {
if (object->isMarked) { // skip over it
object->isMarked = false; // rest to white
object->isMarked = false; // reset to white
prev = object;
object = object->next;
} else { // free it!
Expand Down

0 comments on commit 39060a6

Please sign in to comment.