eris: table nodes now have room to store sequence number

This commit is contained in:
2021-07-07 13:29:18 -04:00
parent 3bf8b1fadb
commit 70b33905da
7 changed files with 356 additions and 101 deletions

View File

@@ -542,29 +542,29 @@ typedef union Closure {
** Tables
*/
typedef union TKey {
struct {
TValuefields;
struct Node *next; /* for chaining */
} nk;
TValue tvk;
} TKey;
typedef struct ANode {
TValue i_val;
int i_sequence;
} ANode;
typedef struct Node {
TValue i_val;
TKey i_key;
ANode anode;
TValue i_key;
struct Node *i_next;
} Node;
typedef struct Table {
CommonHeader;
lu_byte flags; /* 1<<p means tagmethod(p) is not present */
lu_byte lsizenode; /* log2 of size of `node' array */
int sizearray; /* size of `array' array */
TValue *array; /* array part */
int nnkeys; /* number of non-nil keys in both array and hash */
int lastdelseq; /* sequence number of last deleted */
ANode *array; /* array part */
Node *node;
Node *lastfree; /* any free position is before this position */
int *sequence; /* locators for all non-nil keys */
ANode *lastdeleted; /* pointer to last deleted item */
struct Table *metatable;
GCObject *gclist;
} Table;