From e8b3499289022c8729900a58ed218d961a85fec8 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 18 Oct 2026 18:52:48 +0100 Subject: Module format and executor: 027's 4b-1, a record field holding bytes (type 5): held as a text is but for UTF-8, its default a constant; a function's bytes in a signature this type too (PURE_SIGNATURE_BYTES gone); no list keyed by bytes; replaced, a text field becomes a bytes field keeping its value (pure_cell_as, kinds_carry); images' headers take its kind; the JSON edge reads it from a string; pure-run shows it as hex; an append asks a record's fields held as bytes from a mask the load makes (record_held) instead of each field's type twice, so b32 runs fewer instructions than b30 (BFS without batches -1.05%, join -0.25%, BFS with batches -0.36%, the rest within 0.04%; the bank's queries s30 against s32 -0.01% to +0.30%); unit test bytes_fields (bytes not UTF-8, a text field replaced by a bytes field, three refused); server_trees with a bytes field; 008 and 027 --- core/module-save.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/module-save.c') diff --git a/core/module-save.c b/core/module-save.c index 3b1284c..f87cd24 100644 --- a/core/module-save.c +++ b/core/module-save.c @@ -221,7 +221,7 @@ static bool read_fields(const unsigned char *bytes, size_t size, size_t *at, uns for (unsigned f = 0; f < count; ++f) { if (!named(bytes, size, at, 0, &l->record[k].kinds[f], l->record[k].names[f])) return false; uint8_t kind = l->record[k].kinds[f]; - if (kind > PURE_CELL_LIST || kind == PURE_CELL_BYTES) return false; + if (kind > PURE_CELL_LIST) return false; for (unsigned g = 0; g < f; ++g) if (!strcmp(l->record[k].names[g], l->record[k].names[f])) return false; l->record[k].items[f] = 0; if (kind != PURE_CELL_LIST) continue; @@ -497,8 +497,8 @@ PURE_COLD PureResult pure_save_open_list(PureApp *app, const PureModule *m, uint if (result == PURE_OK && pure_draft_revision(*legacy) && pure_draft_size(*legacy)) result = read_whole(*legacy, &bytes, &size); } - /* The stored record graph: its fields' kinds (PURE_CELL_...: a record's, no runtime bytes) and names, and the - * records of the lists in its fields (an image's alone, 027's stage 3). */ + /* The stored record graph: its fields' kinds (PURE_CELL_...: a record's, its lists' PURE_CELL_LIST) and names, and + * the records of the lists in its fields (an image's alone, 027's stage 3). */ PureLayout stored_layout = {.records = 1}; unsigned count = 0; size_t at = 0, items = 0; -- cgit v1.2.3