lua源码阅读顺序-建议
原文链接 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
Lua虚拟机指令介绍
作者:nicochen,腾讯 IEG 游戏开发工程师 本文从一个简单示例入手,详细讲解 Lua 字节码文件的存储结构及各字段含义,进而引出 Lua 虚拟机指令集和运行
探索Lua52内部实现:GC3
GC步骤 global_State中的gcstate记录了当前incremental gc的执行状态。根据执行状态,整个gc过程被分为很多步执行
探索Lua52内部实现:GC2
原文链接 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;
探索Lua5.2内部实现:Garbage Collection(1) 原理
原文链接 Lua5.2采用垃圾回收机制对所有的lua对象(GCObject)进行管理。Lua虚拟机会定期运行GC,释放掉已经不再被被引用到的l
探索Lua52内部实现-Function
原文链接 基本概念 Lua函数引入了很多functional programming的概念,这些概念使得Lua函数在使用上可谓“功能强大,简洁统一
探索Lua52内部实现:TString
原文链接 Lua使用TString结构体代表一个字符串对象。 /* ** Header for string value; string bytes follow the end of this structure */ typedef union TString { L_Umaxalign dummy; /* ensures maximum alignment for strings */ struct { CommonHeader; lu_byte extra; /* reserved words for short strings; "has hash"