Lua
文章平均质量分 92
Lua相关
-沧海流云-
这个作者很懒,什么都没留下…
展开
-
Lua源码之表
lua版本:5.3.5数据结构 table是lua唯一的数据结构,也是lua最明显的特色之一,使用者可以在table的基础上实现各种各样的数据结构。table即可以作为数组,又可以作为哈希表,而在实现上,源码里也是将table的内部存储分为了数组和哈希表。/*** Tables*/typedef union TKey { struct { TValuefields; int next; /* for chaining (offset for next node) */原创 2020-08-08 13:39:07 · 229 阅读 · 0 评论 -
Lua源码之字符串
lua版本:5.3.5数据结构 lua的字符串分为短字符串和长字符串:/* Variant tags for strings */#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4)) /* short strings */#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */ 字符串结构体定义代码:/*** Common Header for all原创 2020-06-25 22:26:04 · 243 阅读 · 0 评论