原文链接 Recommended reading order: lmathlib.c, lstrlib.c: get familiar with the external C API. Don’t bother with the pattern matcher though. Just the easy functions. lapi.c: Check how the API is implemented internally. Only skim this to get a feeling for the code. Cross-reference to lua.h and luaconf.h as needed. lobject.h: tagged values and object representation. skim through this first. you’ll want to keep a window with this
原文链接 GCObject Lua使用union GCObject来表示所有的垃圾回收对象: 182 /* 183 ** Union of all collectable objects 184 */ 185 union GCObject { 186 GCheader gch; /* common header */ 187 union TString ts; 188 union Udata u; 189 union Closure cl;