MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / traversestrongtable

Function traversestrongtable

3rd/lua-5.4.3/src/lgc.c:517–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515
516
517static void traversestrongtable (global_State *g, Table *h) {
518 Node *n, *limit = gnodelast(h);
519 unsigned int i;
520 unsigned int asize = luaH_realasize(h);
521 for (i = 0; i < asize; i++) /* traverse array part */
522 markvalue(g, &h->array[i]);
523 for (n = gnode(h, 0); n < limit; n++) { /* traverse hash part */
524 if (isempty(gval(n))) /* entry is empty? */
525 clearkey(n); /* clear its key */
526 else {
527 lua_assert(!keyisnil(n));
528 markkey(g, n);
529 markvalue(g, gval(n));
530 }
531 }
532 genlink(g, obj2gco(h));
533}
534
535
536static lu_mem traversetable (global_State *g, Table *h) {

Callers 1

traversetableFunction · 0.85

Calls 3

luaH_realasizeFunction · 0.85
clearkeyFunction · 0.85
genlinkFunction · 0.85

Tested by

no test coverage detected