free all objects in matrix

This commit is contained in:
Cloud Wu
2019-06-13 14:55:57 +08:00
parent a04e6b5b29
commit ca4f549f0d

View File

@@ -733,8 +733,13 @@ static void freeobj (lua_State *L, GCObject *o) {
}
#define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM)
static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count);
static void sweepwholelist (lua_State *L, GCObject **p) {
while (*p != NULL) {
GCObject *curr = *p;
*p = curr->next; /* remove 'curr' from list */
freeobj(L, curr); /* erase 'curr' */
}
}
/*