diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-02-29 12:37:09 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-02-29 12:37:09 -0500 |
| commit | ec75208980f29628604aed45a4f64cfa3c62e0df (patch) | |
| tree | b1cf929cb2735f8ad258c60317410e111ad58462 /builtins/datatypes.h | |
| parent | a7bbbe9584f6e4cd35c9a78e8f83b458ddd8f914 (diff) | |
Fix up some import issues and improve arrays to use saturating refcounts
instead of .copy_on_write
Diffstat (limited to 'builtins/datatypes.h')
| -rw-r--r-- | builtins/datatypes.h | 12 |
1 files changed, 7 insertions, 5 deletions
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 <stdint.h> #include <stdbool.h> +#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; |
