As an article about LUA, gc is mentioned by looking at the โThree-color incremental sign and scanโ at the end of this section,
This is the GC algorithm used by Lua 5.1 / 5.2 and LuaJIT 1.x / 2.0. This is an enhancement to the linked list algorithm from Lua 5.0. The tables use reverse barriers, all other objects passing through the road use obstacles.
I read the source code lua_rawset
it uses. luaC_barrierback(L, hvalue(o), L->top-1);
It is common sense that a barrier backward slows down the progress of gc (gray image and re-moving the table object).
My question is: WHY does the author choose the barrier barrier instead of the barrier path (gc performance acceleration) ON lua table write ??? any benefits?
source
share