diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-02 23:57:30 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-02 23:57:30 -0400 |
| commit | baea09062482674220a3686d488a283e6b9b8821 (patch) | |
| tree | 33df470af1db2be53fabac50762c375951acb84e /src/stdlib/datatypes.h | |
| parent | 126050a6357d7ec1fd9901256de50923b6dd7c49 (diff) | |
| parent | 597699243a6f935231ad83e63d22bf6ff9e4e547 (diff) | |
Merge branch 'zero-nones' into dev
Diffstat (limited to 'src/stdlib/datatypes.h')
| -rw-r--r-- | src/stdlib/datatypes.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/stdlib/datatypes.h b/src/stdlib/datatypes.h index 373cbc47..fc665401 100644 --- a/src/stdlib/datatypes.h +++ b/src/stdlib/datatypes.h @@ -41,7 +41,7 @@ typedef struct { // structs can be passed in two 64-bit registers. C will handle doing the // bit arithmetic to extract the necessary values, which is cheaper than // spilling onto the stack and needing to retrieve data from the stack. - int64_t length : LIST_LENGTH_BITS; + uint64_t length : LIST_LENGTH_BITS; uint64_t free : LIST_FREE_BITS; bool atomic : LIST_ATOMIC_BITS; uint8_t data_refcount : LIST_REFCOUNT_BITS; @@ -73,11 +73,11 @@ typedef struct { void *fn, *userdata; } Closure_t; -enum text_type { TEXT_ASCII, TEXT_GRAPHEMES, TEXT_CONCAT, TEXT_BLOB }; +enum text_type { TEXT_NONE, TEXT_ASCII, TEXT_GRAPHEMES, TEXT_CONCAT, TEXT_BLOB }; typedef struct Text_s { - int64_t length : 54; // Number of grapheme clusters - uint8_t tag : 2; + uint64_t length : 53; // Number of grapheme clusters + uint8_t tag : 3; uint8_t depth : 8; union { struct { @@ -117,7 +117,7 @@ typedef struct { typedef struct { Byte_t value; - bool is_none : 1; + bool has_value : 1; } OptionalByte_t; -#define NONE_BYTE ((OptionalByte_t){.is_none = true}) +#define NONE_BYTE ((OptionalByte_t){.has_value = false}) |
