Add table.clear().
This commit is contained in:
11
src/lj_tab.c
11
src/lj_tab.c
@@ -204,6 +204,17 @@ GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt)
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Clear a table. */
|
||||
void LJ_FASTCALL lj_tab_clear(GCtab *t)
|
||||
{
|
||||
clearapart(t);
|
||||
if (t->hmask > 0) {
|
||||
Node *node = noderef(t->node);
|
||||
setmref(node->freetop, &node[t->hmask+1]);
|
||||
clearhpart(t);
|
||||
}
|
||||
}
|
||||
|
||||
/* Free a table. */
|
||||
void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user