jstext properly used for oncat

This commit is contained in:
2026-02-18 17:58:36 -06:00
parent 81561d426b
commit 34521e44f1
2 changed files with 20 additions and 18 deletions

View File

@@ -906,8 +906,9 @@ typedef struct JSBlob {
} JSBlob;
typedef struct JSText {
objhdr_t hdr; /* mist header */
word_t length; /* length (or hash for stoned text) */
objhdr_t hdr; /* mist header — cap56 = allocated capacity */
word_t length; /* character count (always) */
word_t hash; /* cached hash (stoned text only) */
word_t packed[]; /* two chars per packed word */
} JSText;
@@ -1029,7 +1030,6 @@ static inline uint64_t fash64_hash_one (uint64_t word) {
}
static inline word_t JSText_len (const JSText *text) {
if (objhdr_s (text->hdr)) return objhdr_cap56 (text->hdr);
return text->length;
}