Fix temporary vector memory layout;

It's important that the bits for the vector type occupy the least
significant bits, so that vectors can be distinguished from pointer
lightuserdata.

When the vector pool was expanded, this broke, causing e.g. Blob
pointers to exhibit undefined behavior when trying to use them as
vectors.

tbh I still don't understand the union/bitfield memory layout.
This commit is contained in:
bjorn 2023-07-03 19:14:27 -07:00
parent d109518c27
commit c5afb32ad2
1 changed files with 1 additions and 1 deletions

View File

@ -46,9 +46,9 @@ typedef enum {
typedef union {
void* pointer;
struct {
unsigned index : 24;
unsigned type : 4;
unsigned generation : 4;
unsigned index : 24;
unsigned padding : 32;
} handle;
} Vector;