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

Function genlink

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

** Check whether object 'o' should be kept in the 'grayagain' list for ** post-processing by 'correctgraylist'. (It could put all old objects ** in the list and leave all the work to 'correctgraylist', but it is ** more efficient to avoid adding elements that will be removed.) Only ** TOUCHED1 objects need to be in the list. TOUCHED2 doesn't need to go ** back to a gray list, but then it must beco

Source from the content-addressed store, hash-verified

422** 'correctgraylist' does when it finds a TOUCHED2 object.)
423*/
424static void genlink (global_State *g, GCObject *o) {
425 lua_assert(isblack(o));
426 if (getage(o) == G_TOUCHED1) { /* touched in this cycle? */
427 linkobjgclist(o, g->grayagain); /* link it back in 'grayagain' */
428 } /* everything else do not need to be linked back */
429 else if (getage(o) == G_TOUCHED2)
430 changeage(o, G_TOUCHED2, G_OLD); /* advance age */
431}
432
433
434/*

Callers 3

traverseephemeronFunction · 0.85
traversestrongtableFunction · 0.85
traverseudataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected