In the article you contacted, they write C code that shows how the values are represented:
union Value { GCObject *gc; void *p; int b; lua_CFunction f; numfield }; typedef union Value Value; struct lua_TObject { int _tt; Value value_; };
As you can see here, Booleans and numbers are stored directly in the TObject structure. Since they are not “distributed in a heap”, this means that they can never “leak”, and therefore garbage collection does not make sense.
It is interesting to note, however, that the garbage collector does not collect links created for things on the C side of things (user data and CC functions). They must be manually managed by C, but this is kind of expected since in this case you are writing C instead of Lua.
source share