Yet another representation for arrays

This "linear" representation (see ltable.h for details) has worse
locality than cells, but the simpler access code seems to compensate
that.
This commit is contained in:
Roberto Ierusalimschy
2024-04-05 15:35:11 -03:00
parent 3507c3380f
commit 5edacafcfa
3 changed files with 65 additions and 44 deletions

View File

@@ -773,15 +773,12 @@ typedef union Node {
#define setnorealasize(t) ((t)->flags |= BITRAS)
typedef struct ArrayCell ArrayCell;
typedef struct Table {
CommonHeader;
lu_byte flags; /* 1<<p means tagmethod(p) is not present */
lu_byte lsizenode; /* log2 of size of 'node' array */
unsigned int alimit; /* "limit" of 'array' array */
ArrayCell *array; /* array part */
Value *array; /* array part */
Node *node;
struct Table *metatable;
GCObject *gclist;