当前位置:网站首页>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 )
边栏推荐
- Install RPM package offline using yum
- Dial up and Ethernet
- 工具笔记 —— 常用自定义工具类(正则,随机数等)
- Real time software source code of COVID-19
- Codeforces 1638 D. Big Brush —— BFS
- Tree reconstruction (pre order + middle order or post order + middle order)
- Codeforces 1637 C. Andrew and stones - simple thinking
- Codeforces 1629 F2. Game on sum (hard version) - Yang Hui's triangle, violence, finding rules
- Axi4 increase burst / wrap burst/ fix burst and narrow transfer
- 【视频课】android studio物联网APP设计制作全套教程--国庆期间全掌握
猜你喜欢

Summary of virtual box usage problems

Alibaba cloud development board haas510 parses serial port JSON data and sends attributes

聊聊MySQL的10大经典错误

After reading the question, you will point to offer 16 Integer power of numeric value

Alibaba cloud development board haas510 connects to the Internet of things platform -- Haas essay solicitation

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

PostgreSQL14安装使用教程

TestEngine with ID ‘junit-vintage‘ failed to discover tests

Alibaba Cloud Development Board haas510 submission Device Properties

Implementing singleton mode of database under QT multithreading
随机推荐
Knowledge of wireless card driver
阿里云开发板HaaS510连接物联网平台--HaaS征文
Implementation of Ackermann function with simulated recursion
【mysql进阶】mysql索引数据结构的演变(四)
Codeforces 1637 B. mex and array - reading, violence
Cmake basic tutorial - 01 a-hello-cmake
使用make方法创建slice切片的坑
Real time software source code of COVID-19
List of common ACM knowledge points (to be continued)
Codeforces 1629 E. grid XOR - simple thinking
Greed issues - Egypt scores
[WUSTCTF2020]颜值成绩查询-1
Alibaba cloud development board haas510 connects to the Internet of things platform -- Haas essay solicitation
Codeforces 1637 D. yet another minimization problem - Mathematics, DP
969. pancake sorting
如何使用android studio制作一个阿里云物联网APP
正点原子STM32F429核心板的插座型号
[advanced MySQL] evolution of MySQL index data structure (IV)
Dial up and Ethernet
Codeforces 1634 F. Fibonacci additions - Fibonacci sequence addition, ideas