** Header for string value; string bytes follow the end of this structure ** (aligned according to 'UTString'; see next). */ typedefstruct { CommonHeader; lu_byte extra; /* reserved words for short strings; "has hash" for longs */ unsignedint hash; size_t len; /* number of characters in string */ struct *hnext;/* linked list for hash table */ } TString;
** Ensures that address after this type is always fully aligned. */ typedefunion UTString { L_Umaxalign dummy; /* ensures maximum alignment for strings 用于最大字节对齐 */ TString tsv; } UTString;
@@ LUAI_MAXSHORTLEN is the maximum length for short strings, that is, ** strings that are internalized. (Cannot be smaller than reserved words ** or tags for metamethods, as these strings must be internalized; ** #("function") = 8, #("__newindex") = 10.) */
/* 在global_State中存储的哈希表结构体 */ typedefstructstringtable { TString **hash; int nuse; /* number of elements 已装元素的个数 */ int size; /* 实际hash桶的大小 */ } stringtable;