当前位置:网站首页>Lua tvalue structure
Lua tvalue structure
2022-06-12 13:57:00 【HyperCall】
LUA TValue
// Its form is as follows :
typedef struct TValue {
Value value_; //raw value
lu_byte tt_; //raw type tag
} TValue;
// Its Value by LUA Of the supported basic types union form
typedef union Value {
struct GCObject *gc;
void *p;
lua_CFunction f;
lua_Integer i;
lua_Number n;
} Value;
// lu_byte tt_ namely unsigned char tt_ For variable types
therefore ttisinteger(o) Equivalent to o->tt_ == 3 ? true : false
union The specific meaning of each item in the structure is :
| Variable | explain |
|---|---|
| GCObject gch | For recycling It is mainly used to connect the cross reference relationship of garbage collection objects |
| void *p | by c Pointer passed in , from c Distribute and release |
| lua_CFunction f | Express C Export to lua Function pointer of ,typedef int (*lua_CFunction) (lua_State *L); |
| lua_Integer i | Represents an integer type ,typedef long long lua_Integer; |
| lua_Number n | Represents a double-precision floating point type ,typedef double lua_Number; |
I found one on the Internet TValue See the following figure for the structure :
There have been some visible changes in the graphics and code , so lua 5.3 The version has some changes compared with the diagram structure , For example, the original use of int Type storage bool It's worth it b, Store all numeric types of double n Split to store integers lua_Integer Of i And storing double precision floating-point numbers n
among GCObject gch Structure , as follows :
typedef struct GCObject {
struct GCObject *next;
unsigned char tt;
unsigned char marked;
} GCObject;
next Point to the next linked list structure ,tt Indicates the type ,marked Is a sign of garbage collection , Specifically LUA 5.3 For the garbage collection mechanism, see :LUA 5.3 Garbage collection mechanism .( Important but not urgent )
边栏推荐
- Remote code injection
- Mold and remainder
- 公司运营中更注重转化的出价策略,如何实现? —Google sem
- Binary tree traversal
- Understanding recursion
- Single bus temperature sensor 18B20 data on cloud (Alibaba cloud)
- 工具笔记 —— 常用自定义工具类(正则,随机数等)
- Formal analysis of Woo Lam protocol with scyther tool
- Codeforces 1637 C. Andrew and stones - simple thinking
- Alibaba cloud development board haas510 submission device attributes
猜你喜欢

【活动早知道】LiveVideoStack近期活动一览

Acwing: topology sequence
![[WUSTCTF2020]颜值成绩查询-1](/img/dc/47626011333a0e853be87e492d8528.png)
[WUSTCTF2020]颜值成绩查询-1
![[wustctf2020] selfie score query -1](/img/90/e4c2882357e0a1c6a80f778887e3f5.png)
[wustctf2020] selfie score query -1

A method of quickly creating test window

Create a small root heap and judge the node relationship (also.C\u str() substr(),atoi(),string. Use of find())

什么是自动出价?它的优势是什么?

Now you must know the pointer

肝了一个月的原创小袁个人博客项目开源啦(博客基本功能都有,还包含后台管理)

阿里云开发板HaaS510响应UART串口指令
随机推荐
十四周作业
使用make方法创建slice切片的坑
SystemC common errors
简述CGI与FASTCGI区别
[WUSTCTF2020]颜值成绩查询-1
阿裏雲開發板HaaS510報送設備屬性
chapter19 Allocation
Greed issues - Egypt scores
[WUSTCTF2020]颜值成绩查询-1
Understanding recursion
Lua common built-in functions
Mold and remainder
Talk about the top 10 classic MySQL errors
TestEngine with ID ‘junit-vintage‘ failed to discover tests
Reverse analysis from x86 to x64tips
Hash tables, sets, maps, trees, heaps, and graphs
[wustctf2020] selfie score query -1
Possible solutions to problems after CodeBlocks installation
【SemiDrive源码分析】【X9芯片启动流程】26 - R5 SafetyOS 之 LK_INIT_LEVEL_TARGET 阶段代码流程分析(TP Drvier、Audio Server初始化)
Use of awlive structures