Got most of the new memory architecture roughed out.

This commit is contained in:
Simon Brooke 2026-03-25 11:24:33 +00:00
parent 19d6b0df29
commit 604fca3c24
36 changed files with 1118 additions and 0 deletions

42
src/c/payloads/string.h Normal file
View file

@ -0,0 +1,42 @@
/**
* payloads/string.h
*
* A string cell.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_payloads_string_h
#define __psse_payloads_string_h
/*
* wide characters
*/
#include <wchar.h>
#include <wctype.h>
#include "memory/pointer.h"
/**
* @brief Tag for string of characters, organised as a linked list.
*/
#define STRINGTAG "STR"
/**
* @brief payload of a string cell.
*
* At least at first, only one UTF character will be stored in each cell. At
* present the payload of a symbol or keyword cell is identical
* to the payload of a string cell.
*/
struct string_payload {
/** the actual character stored in this cell */
wint_t character;
/** a hash of the string value, computed at store time. */
uint32_t hash;
/** the remainder of the string following this character. */
struct cons_pointer cdr;
};
#endif