From ba710603811c68fe3a69b3bb98e9038d37489a79 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 15 Mar 2024 11:23:35 -0300 Subject: Removed "bulk operations" Negligible performance gains don't justify extra complexity. --- ltable.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'ltable.h') diff --git a/ltable.h b/ltable.h index 8688264c..8b0340b5 100644 --- a/ltable.h +++ b/ltable.h @@ -87,32 +87,20 @@ /* -** The array part of a table is represented by an array of *cells*. +** The array part of a table is represented by an array of cells. ** Each cell is composed of NM tags followed by NM values, so that ** no space is wasted in padding. */ #define NM cast_uint(sizeof(Value)) - -/* -** A few operations on arrays can be performed "in bulk", treating all -** tags of a cell as a simple (or a few) word(s). The next constant is -** the number of words to cover the tags of a cell. (In conventional -** architectures that will be 1 or 2.) -*/ -#define BKSZ cast_int((NM - 1) / sizeof(lua_Unsigned) + 1) - struct ArrayCell { - union { - lua_Unsigned bulk[BKSZ]; /* for "bulk" operations */ - lu_byte tag[NM]; - } u; + lu_byte tag[NM]; Value value[NM]; }; /* Computes the address of the tag for the abstract index 'k' */ -#define getArrTag(t,k) (&(t)->array[(k)/NM].u.tag[(k)%NM]) +#define getArrTag(t,k) (&(t)->array[(k)/NM].tag[(k)%NM]) /* Computes the address of the value for the abstract index 'k' */ #define getArrVal(t,k) (&(t)->array[(k)/NM].value[(k)%NM]) -- cgit v1.2.3-55-g6feb