From ec75208980f29628604aed45a4f64cfa3c62e0df Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 29 Feb 2024 12:37:09 -0500 Subject: Fix up some import issues and improve arrays to use saturating refcounts instead of .copy_on_write --- builtins/datatypes.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'builtins/datatypes.h') diff --git a/builtins/datatypes.h b/builtins/datatypes.h index 3a2a9da7..649de7a6 100644 --- a/builtins/datatypes.h +++ b/builtins/datatypes.h @@ -2,12 +2,14 @@ #include #include +#define MIN_STRIDE (INT16_MIN>>1) +#define MAX_STRIDE (INT16_MAX>>1) typedef struct { void *data; int64_t length:42; - uint8_t free:4; - bool copy_on_write:1, atomic:1; - int16_t stride:16; + uint8_t free:4, data_refcount:2; + bool atomic:1; + int16_t stride:15; } array_t; typedef struct { @@ -16,8 +18,8 @@ typedef struct { } bucket_t; typedef struct { - uint32_t count:32, last_free:31; - bool copy_on_write:1; + uint32_t count:31, last_free:31; + uint8_t data_refcount:2; bucket_t buckets[0]; } bucket_info_t; -- cgit v1.2.3