minor refactoring

This commit is contained in:
CPunch 2023-08-25 23:34:21 -05:00 committed by cpunch
parent c5e4305ef8
commit 3f39211081
3 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,9 @@
// realloc wrapper
void *cosmoM_reallocate(CState *state, void *buf, size_t oldSize, size_t newSize)
{
if (buf == NULL) oldSize = 0;
if (buf == NULL)
oldSize = 0;
#ifdef GC_DEBUG
printf("old allocated bytes: %ld\n", state->allocatedBytes);
if (buf) {

View File

@ -188,10 +188,10 @@ CObjObject *cosmoO_newObject(CState *state)
obj->userP = NULL; // reserved for C API
obj->userT = 0;
obj->isLocked = false;
cosmoV_pushRef(state, (CObj *)obj); // so our GC can keep track of it
cosmoT_initTable(state, &obj->tbl, ARRAY_START);
cosmoV_pop(state);
return obj;
}

View File

@ -764,7 +764,6 @@ int cosmoV_execute(CState *state)
{
uint8_t indx = READBYTE(frame);
cosmoV_pushValue(state, frame->base[indx]);
continue;
}
CASE(OP_GETUPVAL) :
{