From c80c7a49fdbd5c6540bd49ef47925edd9eed8c99 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 21 Feb 2018 13:28:12 -0300 Subject: [PATCH] details (comments) --- lobject.h | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/lobject.h b/lobject.h index 03396f11..5d6abdd1 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.133 2018/01/28 15:13:26 roberto Exp roberto $ +** $Id: lobject.h,v 2.134 2018/02/20 16:52:50 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -88,12 +88,6 @@ struct GCObject { - -/* -** Tagged Values. This is the basic representation of values in Lua, -** an actual value plus a tag with its type. -*/ - /* ** Union of all Lua values */ @@ -107,8 +101,12 @@ typedef union Value { } Value; -#define TValuefields Value value_; lu_byte tt_ +/* +** Tagged Values. This is the basic representation of values in Lua: +** an actual value plus a tag with its type. +*/ +#define TValuefields Value value_; lu_byte tt_ typedef struct TValue { TValuefields; @@ -301,14 +299,6 @@ typedef struct TValue { - -/* -** {====================================================== -** types and prototypes -** ======================================================= -*/ - - typedef union StackValue { TValue val; } StackValue; @@ -321,6 +311,12 @@ typedef StackValue *StkId; /* index to stack elements */ +/* +** {================================================================== +** Strings +** =================================================================== +*/ + /* ** Header for string value; string bytes follow the end of this structure ** (aligned according to 'UTString'; see next). @@ -363,6 +359,8 @@ typedef union UTString { /* get string length from 'TValue *o' */ #define vslen(o) tsslen(tsvalue(o)) +/* }================================================================== */ + /* ** {================================================================== @@ -404,7 +402,6 @@ typedef struct Udata { /* }================================================================== */ - /* ** {================================================================== ** Prototypes @@ -480,6 +477,11 @@ typedef struct Proto { /* }================================================================== */ +/* +** {================================================================== +** Closures +** =================================================================== +*/ /* ** Upvalues for Lua closures @@ -529,14 +531,17 @@ typedef union Closure { #define getproto(o) (clLvalue(o)->p) +/* }================================================================== */ + /* +** {================================================================== ** Tables +** =================================================================== */ - /* -** Nodes for Hash tables. A pack of two TValue's (key-value pairs) +** Nodes for Hash tables: A pack of two TValue's (key-value pairs) ** plus a 'next' field to link colliding entries. The distribution ** of the key's fields ('key_tt' and 'key_val') not forming a proper ** 'TValue' allows for a smaller size for 'Node' both in 4-byte @@ -609,6 +614,8 @@ typedef struct Table { */ #define setdeadkey(n) (keytt(n) = LUA_TTABLE, gckey(n) = NULL) +/* }================================================================== */ + /*