Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Digression: Lua tagged values (TValues)<br />
Each value in Lua is 12 bytes *<br />
local a = "hello, world"<br />
local b = 1337<br />
*<br />
Typically, as we'll see soon<br />
First field: union between several<br />
different datatypes (8 bytes/64 bits,<br />
because numbers in Lua are doubles)<br />
Heap<br />
TString<br />
"hello, world"<br />
Second field: type tag to identify how<br />
to read the union (4 bytes/32 bits)<br />
Each function's local variable stack is<br />
just an array of TValues, which grows<br />
up<br />
Lua stack<br />
(TString *)0xdeadbeef<br />
(double)1337<br />
0x04<br />
0x03<br />
Value<br />
Tag