Compare commits
No commits in common. "04bf001652864981a6d7819299ff1d875c8a4fd9" and "cae27731b7ea84c745455f76e84a05cfddffa94b" have entirely different histories.
04bf001652
...
cae27731b7
34 changed files with 286 additions and 784 deletions
|
|
@ -119,7 +119,7 @@ We don't currently have any other mutable objects, but in future at least lazy o
|
||||||
|
|
||||||
Secondly, reading from a namespace does not happen in a single clock tick, it takes quite a long time. So it's no good setting a lock bit on the namespace object itself and then immediately assuming that it's now mutable. A reading process could already have started, and be proceeding.
|
Secondly, reading from a namespace does not happen in a single clock tick, it takes quite a long time. So it's no good setting a lock bit on the namespace object itself and then immediately assuming that it's now mutable. A reading process could already have started, and be proceeding.
|
||||||
|
|
||||||
So what I think is, that we have a single top level function, `(::substrate:search-store key store return-key?)` (which we already sort of have in the 0.0.6 prototype, [here](https://www.journeyman.cc/post-scarcity/doc/html/intern_8c.html#a2189c0ab60e57a70adeb32aca99dbc43)). This searches a store (hashmap, namespace, association list, or hybrid association list) to find a binding for a key, and, having found that binding, then, if there is a namespace on the search path, checks whether the lock on the any namespace on the search path is set, and if it is, aborts the search and tries again; but otherwise returns either the key found (if `return-key?` is non-`nil`), or the value found otherwise.
|
So what I think is, that we have a single top level function, `(::substrate:search-store key store return-key?)` (which we already sort of have in the 0.0.6 prototype, [here](https://www.journeyman.cc/post-scarcity/doc/html/intern_8c.html#a2189c0ab60e57a70adeb32aca99dbc43)). This searches a store (hashmap, namespace, association list, or hybrid association list) to find a binding for a key, and, having found that binding, then, if there is a namespace on the search path, checks whether the lock on the any namespace on the search path is set, and it it is, aborts the search and tries again; but otherwise returns either the key found (if `return-key?` is non-`nil`), or the value found otherwise.
|
||||||
|
|
||||||
This function implements the user-level Lisp functions `assoc`, `interned`, and `interned?`. It also implements *hashmap-in-function-position* and *keyword-in-function-position*, in so far as both of these are treated as calls to `assoc`.
|
This function implements the user-level Lisp functions `assoc`, `interned`, and `interned?`. It also implements *hashmap-in-function-position* and *keyword-in-function-position*, in so far as both of these are treated as calls to `assoc`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,6 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* wide characters
|
|
||||||
*/
|
|
||||||
#include <wchar.h>
|
|
||||||
#include <wctype.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Print messages debugging memory allocation.
|
* @brief Print messages debugging memory allocation.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ struct pso_header {
|
||||||
char mnemonic[TAGLENGTH];
|
char mnemonic[TAGLENGTH];
|
||||||
/** size class for this object */
|
/** size class for this object */
|
||||||
uint8_t size_class;
|
uint8_t size_class;
|
||||||
} bytes;
|
} tag;
|
||||||
/** the tag considered as a number */
|
/** the tag considered as a number */
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
} tag;
|
} tag;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
* since managed objects require a two word header; it's unlikely that
|
* since managed objects require a two word header; it's unlikely that
|
||||||
* these undersized size classes will be used at all.
|
* these undersized size classes will be used at all.
|
||||||
*/
|
*/
|
||||||
#define MAX_SIZE_CLASS 0xf
|
#define MAX_SIZE_CLASS = 0xf
|
||||||
|
|
||||||
int initialise_memory( );
|
int initialise_memory( );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "debug.h"
|
|
||||||
#include "memory/memory.h"
|
#include "memory/memory.h"
|
||||||
#include "memory/node.h"
|
#include "memory/node.h"
|
||||||
#include "memory/page.h"
|
#include "memory/page.h"
|
||||||
|
|
@ -39,13 +36,13 @@
|
||||||
* to hold the number of pages we *might* create at start up time. We need a
|
* to hold the number of pages we *might* create at start up time. We need a
|
||||||
* way to grow the number of pages, while keeping access to them cheap.
|
* way to grow the number of pages, while keeping access to them cheap.
|
||||||
*/
|
*/
|
||||||
union page * pages[NPAGES];
|
struct page * pages[NPAGES];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief the number of pages which have thus far been allocated.
|
* @brief the number of pages which have thus far been allocated.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint32_t npages_allocated = 0;
|
uint32_t npages_allocated = 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief private to allocate_page; do not use.
|
* @brief private to allocate_page; do not use.
|
||||||
|
|
@ -54,11 +51,10 @@ uint32_t npages_allocated = 0;
|
||||||
* @param page_index its location in the pages[] array;
|
* @param page_index its location in the pages[] array;
|
||||||
* @param size_class the size class of objects in this page;
|
* @param size_class the size class of objects in this page;
|
||||||
* @param freelist the freelist for objects of this size class.
|
* @param freelist the freelist for objects of this size class.
|
||||||
* @return struct pso_pointer the new head for the freelist for this size_class,
|
* @return struct cons_pointer the new head for the freelist for this size_class,
|
||||||
*/
|
*/
|
||||||
struct pso_pointer initialise_page( union page* page_addr, uint16_t page_index,
|
struct cons_pointer initialise_page( struct page * page_addr, uint16_t page_index, uint8_t size_class, pso_pointer freelist) {
|
||||||
uint8_t size_class, struct pso_pointer freelist) {
|
struct cons_pointer result = freelist;
|
||||||
struct pso_pointer result = freelist;
|
|
||||||
int obj_size = pow(2, size_class);
|
int obj_size = pow(2, size_class);
|
||||||
int obj_bytes = obj_size * sizeof(uint64_t);
|
int obj_bytes = obj_size * sizeof(uint64_t);
|
||||||
int objs_in_page = PAGE_BYTES/obj_bytes;
|
int objs_in_page = PAGE_BYTES/obj_bytes;
|
||||||
|
|
@ -68,14 +64,16 @@ struct pso_pointer initialise_page( union page* page_addr, uint16_t page_index,
|
||||||
// `nil` and the next on for `t`.
|
// `nil` and the next on for `t`.
|
||||||
for (int i = objs_in_page - 1; i >= 0; i--) {
|
for (int i = objs_in_page - 1; i >= 0; i--) {
|
||||||
// it should be safe to cast any pso object to a pso2
|
// it should be safe to cast any pso object to a pso2
|
||||||
struct pso2* object = (struct pso2 *)(page_addr + (i * obj_bytes));
|
struct pso2* object = (pso2 *)(page_addr + (i * obj_bytes));
|
||||||
|
|
||||||
object->header.tag.bytes.size_class = size_class;
|
object->header.tag.size_class = size_class;
|
||||||
strncpy( (char *)(object->header.tag.bytes.mnemonic), FREETAG, TAGLENGTH);
|
strncpy( (char *)(object->header.tag.mnemonic), FREETAG, TAGLENGTH);
|
||||||
object->payload.free.next = result;
|
object->payload.free.next = result;
|
||||||
|
|
||||||
result = make_pointer( node_index, page_index, (uint16_t)( i * obj_size));
|
result = make_pointer( node_index, page_index, (uint16_t)( i * obj_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,8 +89,8 @@ struct pso_pointer initialise_page( union page* page_addr, uint16_t page_index,
|
||||||
* @param size_class an integer in the range 0...MAX_SIZE_CLASS.
|
* @param size_class an integer in the range 0...MAX_SIZE_CLASS.
|
||||||
* @return t on success, an exception if an error occurred.
|
* @return t on success, an exception if an error occurred.
|
||||||
*/
|
*/
|
||||||
struct pso_pointer allocate_page( uint8_t size_class ) {
|
struct cons_pointer allocate_page( uint8_t size_class ) {
|
||||||
struct pso_pointer result = t;
|
struct cons_pointer result = t;
|
||||||
|
|
||||||
if ( npages_allocated == 0) {
|
if ( npages_allocated == 0) {
|
||||||
for (int i = 0; i < NPAGES; i++) {
|
for (int i = 0; i < NPAGES; i++) {
|
||||||
|
|
@ -103,17 +101,17 @@ struct pso_pointer allocate_page( uint8_t size_class ) {
|
||||||
|
|
||||||
if ( npages_allocated < NPAGES) {
|
if ( npages_allocated < NPAGES) {
|
||||||
if ( size_class >= 2 && size_class <= MAX_SIZE_CLASS ) {
|
if ( size_class >= 2 && size_class <= MAX_SIZE_CLASS ) {
|
||||||
void* pg = malloc( sizeof( union page ) );
|
result = malloc( sizeof( page ) );
|
||||||
|
|
||||||
if ( pg != NULL ) {
|
if ( result != NULL ) {
|
||||||
memset( pg, 0, sizeof( union page ) );
|
memset( result, 0, sizeof( page ) );
|
||||||
pages[ npages_allocated] = pg;
|
pages[ npages_allocated] = result;
|
||||||
debug_printf( DEBUG_ALLOC, 0,
|
debug_printf( DEBUG_ALLOC, 0,
|
||||||
L"Allocated page %d for objects of size class %x.\n",
|
L"Allocated page %d for objects of size class %x.\n",
|
||||||
npages_allocated, size_class);
|
npages_allocated, size_class);
|
||||||
|
|
||||||
freelists[size_class] =
|
freelists[size_class] =
|
||||||
initialise_page( (union page*)pg, npages_allocated, size_class, freelists[size_class] );
|
initialise_page( result, npages_allocated, size_class, freelists[size_class] );
|
||||||
|
|
||||||
debug_printf( DEBUG_ALLOC, 0,
|
debug_printf( DEBUG_ALLOC, 0,
|
||||||
L"Initialised page %d; freelist for size class %x updated.\n",
|
L"Initialised page %d; freelist for size class %x updated.\n",
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#ifndef __psse_memory_page_h
|
#ifndef __psse_memory_page_h
|
||||||
#define __psse_memory_page_h
|
#define __psse_memory_page_h
|
||||||
|
|
||||||
#include "memory/pointer.h"
|
|
||||||
#include "memory/pso2.h"
|
#include "memory/pso2.h"
|
||||||
#include "memory/pso3.h"
|
#include "memory/pso3.h"
|
||||||
#include "memory/pso4.h"
|
#include "memory/pso4.h"
|
||||||
|
|
@ -39,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
#define NPAGES 64
|
#define NPAGES 64
|
||||||
|
|
||||||
extern union page *pages[NPAGES];
|
extern struct page *pages[NPAGES];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A page is a megabyte of memory which contains objects all of which
|
* @brief A page is a megabyte of memory which contains objects all of which
|
||||||
|
|
@ -54,25 +53,22 @@ extern union page *pages[NPAGES];
|
||||||
* collection they will be returned to that freelist.
|
* collection they will be returned to that freelist.
|
||||||
*/
|
*/
|
||||||
union page {
|
union page {
|
||||||
uint8_t bytes[PAGE_BYTES];
|
uint8_t[PAGE_BYTES] bytes;
|
||||||
uint64_t words[PAGE_BYTES / 8];
|
uint64_t[PAGE_BYTES / 8] words;
|
||||||
struct pso2 pso2s[PAGE_BYTES / 32];
|
struct pso2[PAGE_BYTES / 32] pso2s;
|
||||||
struct pso3 pso3s[PAGE_BYTES / 64];
|
struct pso3[PAGE_BYTES / 64] pso3s;
|
||||||
struct pso4 pso4s[PAGE_BYTES / 128];
|
struct pso4[PAGE_BYTES / 128] pso4s;
|
||||||
struct pso5 pso5s[PAGE_BYTES / 256];
|
struct pso5[PAGE_BYTES / 256] pso5s;
|
||||||
struct pso6 pso6s[PAGE_BYTES / 512];
|
struct pso6[PAGE_BYTES / 512] pso6s;
|
||||||
struct pso7 pso7s[PAGE_BYTES / 1024];
|
struct pso7[PAGE_BYTES / 1024] pso7s;
|
||||||
struct pso8 pso8s[PAGE_BYTES / 2048];
|
struct pso8[PAGE_BYTES / 2048] pso8s;
|
||||||
struct pso9 pso9s[PAGE_BYTES / 4096];
|
struct pso9[PAGE_BYTES / 4096] pso9s;
|
||||||
struct psoa psoas[PAGE_BYTES / 8192];
|
struct psoa[PAGE_BYTES / 8192] psoas;
|
||||||
struct psob psobs[PAGE_BYTES / 16384];
|
struct psob[PAGE_BYTES / 16384] psobs;
|
||||||
struct psoc psocs[PAGE_BYTES / 32768];
|
struct psoc[PAGE_BYTES / 32768] psocs;
|
||||||
struct psod psods[PAGE_BYTES / 65536];
|
struct psod[PAGE_BYTES / 65536] psods;
|
||||||
struct psoe psoes[PAGE_BYTES / 131072];
|
struct psoe[PAGE_BYTES / 131072] psoes;
|
||||||
struct psof psofs[PAGE_BYTES / 262144];
|
struct psof[PAGE_BYTES / 262144] psofs;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pso_pointer initialise_page( union page * page_addr, uint16_t page_index,
|
|
||||||
uint8_t size_class, struct pso_pointer freelist);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -14,234 +14,234 @@
|
||||||
|
|
||||||
#include "memory/header.h"
|
#include "memory/header.h"
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
// #include "payloads/cons.h"
|
#include "payloads/cons.h"
|
||||||
// #include "payloads/exception.h"
|
#include "payloads/exception.h"
|
||||||
// #include "payloads/free.h"
|
#include "payloads/free.h"
|
||||||
// #include "payloads/function.h"
|
#include "payloads/function.h"
|
||||||
// #include "payloads/hashtable.h"
|
#include "payloads/hashtable.h"
|
||||||
// #include "payloads/integer.h"
|
#include "payloads/integer.h"
|
||||||
// #include "payloads/keyword.h"
|
#include "payloads/keyword.h"
|
||||||
// #include "payloads/lambda.h"
|
#include "payloads/lambda.h"
|
||||||
// #include "payloads/mutex.h"
|
#include "payloads/mutex.h"
|
||||||
// #include "payloads/namespace.h"
|
#include "payloads/namespace.h"
|
||||||
// #include "payloads/nlambda.h"
|
#include "payloads/nlambda.h"
|
||||||
// #include "payloads/read_stream.h"
|
#include "payloads/read_stream.h"
|
||||||
// #include "payloads/special.h"
|
#include "payloads/special.h"
|
||||||
// #include "payloads/stack.h"
|
#include "payloads/stack.h"
|
||||||
// #include "payloads/string.h"
|
#include "payloads/string.h"
|
||||||
// #include "payloads/symbol.h"
|
#include "payloads/symbol.h"
|
||||||
// #include "payloads/time.h"
|
#include "payloads/time.h"
|
||||||
// #include "payloads/vector_pointer.h"
|
#include "payloads/vector_pointer.h"
|
||||||
// #include "payloads/write_stream.h"
|
#include "payloads/write_stream.h"
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 2, four words total, two words
|
* @brief A paged space object of size class 2, four words total, two words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso2 {
|
struct pso2 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[16];
|
char bytes[16];
|
||||||
// uint64_t words[2];
|
uint64_t words[2];
|
||||||
// struct cons_payload cons;
|
struct cons_payload cons;
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// struct function_payload function;
|
struct function_payload function;
|
||||||
// struct integer_payload integer;
|
struct integer_payload integer;
|
||||||
// struct lambda_payload lambda;
|
struct lambda_payload lambda;
|
||||||
// struct special_payload special;
|
struct special_payload special;
|
||||||
// struct stream_payload stream;
|
struct stream_payload stream;
|
||||||
// struct time_payload time;
|
struct time_payload time;
|
||||||
// struct vectorp_payload vectorp;
|
struct vectorp_payload vectorp;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 3, 8 words total, 6 words
|
* @brief A paged space object of size class 3, 8 words total, 6 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso3 {
|
struct pso3 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[48];
|
char bytes[48];
|
||||||
// uint64_t words[6];
|
uint64_t words[6];
|
||||||
// struct exception_payload exception;
|
struct exception_payload exception;
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// struct mutex_payload mutex;
|
struct mutex_payload mutex;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 4, 16 words total, 14 words
|
* @brief A paged space object of size class 4, 16 words total, 14 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso4 {
|
struct pso4 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[112];
|
char bytes[112];
|
||||||
// uint64_t words[14];
|
uint64_t words[14];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// struct stack_frame_payload stack_frame;
|
struct stack_frame_payload stack_frame;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 5, 32 words total, 30 words
|
* @brief A paged space object of size class 5, 32 words total, 30 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso5 {
|
struct pso5 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[240];
|
char bytes[240];
|
||||||
// uint64_t words[30];
|
uint64_t words[30];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 6, 64 words total, 62 words
|
* @brief A paged space object of size class 6, 64 words total, 62 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso6 {
|
struct pso6 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[496];
|
char bytes[496];
|
||||||
// uint64_t words[62];
|
uint64_t words[62];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// struct hashtable_payload hashtable;
|
struct hashtable_payload hashtable;
|
||||||
// struct namespace_payload namespace;
|
struct namespace_payload namespace;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 7, 128 words total, 126 words
|
* @brief A paged space object of size class 7, 128 words total, 126 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso7 {
|
struct pso7 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[1008];
|
char bytes[1008];
|
||||||
// uint64_t words[126];
|
uint64_t words[126];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 8, 256 words total, 254 words
|
* @brief A paged space object of size class 8, 256 words total, 254 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso8 {
|
struct pso8 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[2032];
|
char bytes[2032];
|
||||||
// uint64_t words[254];
|
uint64_t words[254];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class 9, 512 words total, 510 words
|
* @brief A paged space object of size class 9, 512 words total, 510 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct pso9 {
|
struct pso9 {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[4080];
|
char bytes[4080];
|
||||||
// uint64_t words[510];
|
uint64_t words[510];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class a, 1024 words total, 1022 words
|
* @brief A paged space object of size class a, 1024 words total, 1022 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct psoa {
|
struct psoa {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[8176];
|
char bytes[8176];
|
||||||
// uint64_t words[1022];
|
uint64_t words[1022];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class b, 2048 words total, 2046 words
|
* @brief A paged space object of size class b, 2048 words total, 2046 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct psob {
|
struct psob {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[16368];
|
char bytes[16368];
|
||||||
// uint64_t words[2046];
|
uint64_t words[2046];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class c, 4096 words total, 4094 words
|
* @brief A paged space object of size class c, 4096 words total, 4094 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct psoc {
|
struct psoc {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[32752];
|
char bytes[32752];
|
||||||
// uint64_t words[4094];
|
uint64_t words[4094];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class d, 8192 words total, 8190 words
|
* @brief A paged space object of size class d, 8192 words total, 8190 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct psod {
|
struct psod {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[65520];
|
char bytes[65520];
|
||||||
// uint64_t words[8190];
|
uint64_t words[8190];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class e, 16384 words total, 16382 words
|
* @brief A paged space object of size class e, 16384 words total, 16382 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct psoe {
|
struct psoe {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[131056];
|
char bytes[131056];
|
||||||
// uint64_t words[16382];
|
uint64_t words[16382];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief A paged space object of size class f, 32768 words total, 32766 words
|
* @brief A paged space object of size class f, 32768 words total, 32766 words
|
||||||
// * payload.
|
* payload.
|
||||||
// *
|
*
|
||||||
// */
|
*/
|
||||||
// struct psof {
|
struct psof {
|
||||||
// struct pso_header header;
|
struct pso_header header;
|
||||||
// union {
|
union {
|
||||||
// char bytes[262128];
|
char bytes[262128];
|
||||||
// uint64_t words[32766];
|
uint64_t words[32766];
|
||||||
// struct free_payload free;
|
struct free_payload free;
|
||||||
// } payload;
|
} payload;
|
||||||
// };
|
};
|
||||||
|
|
||||||
struct pso_pointer allocate( char* tag, uint8_t size_class);
|
struct pso_pointer allocate( char* tag, uint8_t size_class);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso2.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 2, four words total, two words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso2_h
|
|
||||||
#define __psse_memory_pso2_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/cons.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
#include "payloads/function.h"
|
|
||||||
#include "payloads/integer.h"
|
|
||||||
#include "payloads/keyword.h"
|
|
||||||
#include "payloads/lambda.h"
|
|
||||||
#include "payloads/nlambda.h"
|
|
||||||
#include "payloads/read_stream.h"
|
|
||||||
#include "payloads/special.h"
|
|
||||||
#include "payloads/string.h"
|
|
||||||
#include "payloads/symbol.h"
|
|
||||||
// #include "payloads/time.h"
|
|
||||||
#include "payloads/vector_pointer.h"
|
|
||||||
#include "payloads/write_stream.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 2, four words total, two words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso2 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[16];
|
|
||||||
uint64_t words[2];
|
|
||||||
struct cons_payload cons;
|
|
||||||
struct free_payload free;
|
|
||||||
struct function_payload function;
|
|
||||||
struct integer_payload integer;
|
|
||||||
struct lambda_payload lambda;
|
|
||||||
// struct special_payload special;
|
|
||||||
struct stream_payload stream;
|
|
||||||
// struct time_payload time;
|
|
||||||
struct vectorp_payload vectorp;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso3.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 3, 8 words total, 6 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso3_h
|
|
||||||
#define __psse_memory_pso3_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/exception.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
#include "payloads/mutex.h"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 3, 8 words total, 6 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso3 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[48];
|
|
||||||
uint64_t words[6];
|
|
||||||
struct exception_payload exception;
|
|
||||||
struct free_payload free;
|
|
||||||
struct mutex_payload mutex;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso4.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 4, 16 words total, 14 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso4_h
|
|
||||||
#define __psse_memory_pso4_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
#include "payloads/stack.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 4, 16 words total, 14 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso4 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[112];
|
|
||||||
uint64_t words[14];
|
|
||||||
struct free_payload free;
|
|
||||||
struct stack_frame_payload stack_frame;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso5.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 5, 32 words total, 30 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso5_h
|
|
||||||
#define __psse_memory_pso5_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 5, 32 words total, 30 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso5 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[240];
|
|
||||||
uint64_t words[30];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso6.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 6, 64 words total, 62 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso6_h
|
|
||||||
#define __psse_memory_pso6_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 6, 64 words total, 62 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso6 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[496];
|
|
||||||
uint64_t words[62];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso7.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 7, 128 words total, 126 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso7_h
|
|
||||||
#define __psse_memory_pso7_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 7, 128 words total, 126 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso7 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[1008];
|
|
||||||
uint64_t words[126];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso8.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 8, 256 words total, 254 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso8_h
|
|
||||||
#define __psse_memory_pso8_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 8, 256 words total, 254 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso8 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[2032];
|
|
||||||
uint64_t words[254];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/pso9.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class 9, 512 words total, 510 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_pso9_h
|
|
||||||
#define __psse_memory_pso9_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class 9, 512 words total, 510 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct pso9 {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[4080];
|
|
||||||
uint64_t words[510];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/psoa.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class a, 1024 words total, 1022 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_psoa_h
|
|
||||||
#define __psse_memory_psoa_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class a, 1024 words total, 1022 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct psoa {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[8176];
|
|
||||||
uint64_t words[1022];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/psob.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class b, 2048 words total, 2046 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_psob_h
|
|
||||||
#define __psse_memory_psob_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class b, 2048 words total, 2046 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct psob {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[16368];
|
|
||||||
uint64_t words[2046];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/psoc.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class c, 4096 words total, 4094 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_psoc_h
|
|
||||||
#define __psse_memory_psoc_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class c, 4096 words total, 4094 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct psoc {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[32752];
|
|
||||||
uint64_t words[4094];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/psod.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class d, 8192 words total, 8190 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_psod_h
|
|
||||||
#define __psse_memory_psod_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class d, 8192 words total, 8190 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct psod {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[65520];
|
|
||||||
uint64_t words[8190];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/psoe.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class e, 16384 words total, 16382 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_psoe_h
|
|
||||||
#define __psse_memory_psoe_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class e, 16384 words total, 16382 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct psoe {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[131056];
|
|
||||||
uint64_t words[16382];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* memory/psof.h
|
|
||||||
*
|
|
||||||
* Paged space object of size class f, 32768 words total, 32766 words payload.
|
|
||||||
*
|
|
||||||
* (c) 2026 Simon Brooke <simon@journeyman.cc>
|
|
||||||
* Licensed under GPL version 2.0, or, at your option, any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __psse_memory_psof_h
|
|
||||||
#define __psse_memory_psof_h
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/header.h"
|
|
||||||
#include "payloads/free.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A paged space object of size class f, 32768 words total, 32766 words
|
|
||||||
* payload.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct psof {
|
|
||||||
struct pso_header header;
|
|
||||||
union {
|
|
||||||
char bytes[262128];
|
|
||||||
uint64_t words[32766];
|
|
||||||
struct free_payload free;
|
|
||||||
} payload;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
#include "memory/node.h"
|
#include "memory/node.h"
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
#include "memory/pso.h"
|
#include "memory/pso.h"
|
||||||
#include "memory/pso2.h"
|
|
||||||
#include "payloads/cons.h"
|
#include "payloads/cons.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#define __psse_payloads_function_h
|
#define __psse_payloads_function_h
|
||||||
|
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
#include "memory/pso4.h"
|
#include "memory/pso.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Tag for an ordinary Lisp function - one whose arguments are pre-evaluated.
|
* @brief Tag for an ordinary Lisp function - one whose arguments are pre-evaluated.
|
||||||
|
|
@ -41,7 +41,7 @@ struct function_payload {
|
||||||
* a cons pointer (representing its result).
|
* a cons pointer (representing its result).
|
||||||
* \todo check this documentation is current!
|
* \todo check this documentation is current!
|
||||||
*/
|
*/
|
||||||
struct pso_pointer ( *executable ) ( struct pso4*,
|
struct pso_pointer ( *executable ) ( struct pso4 *,
|
||||||
struct pso_pointer,
|
struct pso_pointer,
|
||||||
struct pso_pointer );
|
struct pso_pointer );
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,10 @@
|
||||||
* i.e. either an assoc list or a further hashtable.
|
* i.e. either an assoc list or a further hashtable.
|
||||||
*/
|
*/
|
||||||
struct hashtable_payload {
|
struct hashtable_payload {
|
||||||
struct pso_pointer hash_fn; /* function for hashing values in this hashtable, or `NIL` to use
|
struct cons_pointer hash_fn; /* function for hashing values in this hashtable, or `NIL` to use
|
||||||
the default hashing function */
|
the default hashing function */
|
||||||
uint32_t n_buckets; /* number of hash buckets */
|
uint32_t n_buckets; /* number of hash buckets */
|
||||||
struct pso_pointer buckets[]; /* actual hash buckets, which should be `NIL`
|
struct cons_pointer buckets[]; /* actual hash buckets, which should be `NIL`
|
||||||
* or assoc lists or (possibly) further hashtables. */
|
* or assoc lists or (possibly) further hashtables. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,16 +48,16 @@
|
||||||
* i.e. either an assoc list or a further namespace.
|
* i.e. either an assoc list or a further namespace.
|
||||||
*/
|
*/
|
||||||
struct namespace_payload {
|
struct namespace_payload {
|
||||||
struct pso_pointer hash_fn; /* function for hashing values in this namespace, or
|
struct cons_pointer hash_fn; /* function for hashing values in this namespace, or
|
||||||
* `NIL` to use the default hashing function */
|
* `NIL` to use the default hashing function */
|
||||||
uint32_t n_buckets; /* number of hash buckets */
|
uint32_t n_buckets; /* number of hash buckets */
|
||||||
uint32_t unused; /* for word alignment and possible later expansion */
|
uint32_t unused; /* for word alignment and possible later expansion */
|
||||||
struct pso_pointer write_acl; /* it seems to me that it is likely that the
|
struct cons_pointer write_acl; /* it seems to me that it is likely that the
|
||||||
* principal difference between a hashtable and a
|
* principal difference between a hashtable and a
|
||||||
* namespace is that a hashtable has a write ACL
|
* namespace is that a hashtable has a write ACL
|
||||||
* of `NIL`, meaning not writeable by anyone */
|
* of `NIL`, meaning not writeable by anyone */
|
||||||
struct pso_pointer mutex; /* the mutex to lock when modifying this namespace.*/
|
struct cons_pointer mutex; /* the mutex to lock when modifying this namespace.*/
|
||||||
struct pso_pointer buckets[]; /* actual hash buckets, which should be `NIL`
|
struct cons_pointer buckets[]; /* actual hash buckets, which should be `NIL`
|
||||||
* or assoc lists or (possibly) further hashtables. */
|
* or assoc lists or (possibly) further hashtables. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
#include "io/fopen.h"
|
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -32,7 +31,7 @@ struct stream_payload {
|
||||||
/** metadata on the stream (e.g. its file attributes if a file, its HTTP
|
/** metadata on the stream (e.g. its file attributes if a file, its HTTP
|
||||||
* headers if a URL, etc). Expected to be an association, or nil. Not yet
|
* headers if a URL, etc). Expected to be an association, or nil. Not yet
|
||||||
* implemented. */
|
* implemented. */
|
||||||
struct pso_pointer meta;
|
struct cons_pointer meta;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
#define __psse_payloads_special_h
|
#define __psse_payloads_special_h
|
||||||
|
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
#include "memory/pso4.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A special form - one whose arguments are not pre-evaluated but passed as
|
* A special form - one whose arguments are not pre-evaluated but passed as
|
||||||
|
|
@ -21,25 +20,25 @@
|
||||||
#define SPECIALTAG "SFM"
|
#define SPECIALTAG "SFM"
|
||||||
#define SPECIALTV 5064275
|
#define SPECIALTV 5064275
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * @brief Payload of a special form cell.
|
* @brief Payload of a special form cell.
|
||||||
// *
|
*
|
||||||
// * Currently identical to the payload of a function cell.
|
* Currently identical to the payload of a function cell.
|
||||||
// * \see function_payload
|
* \see function_payload
|
||||||
// */
|
*/
|
||||||
// struct special_payload {
|
struct special_payload {
|
||||||
// /**
|
/**
|
||||||
// * pointer to the source from which the special form was compiled, or NIL
|
* pointer to the source from which the special form was compiled, or NIL
|
||||||
// * if it is a primitive.
|
* if it is a primitive.
|
||||||
// */
|
*/
|
||||||
// struct pso_pointer meta;
|
struct pso_pointer meta;
|
||||||
// /** pointer to a function which takes a cons pointer (representing
|
/** pointer to a function which takes a cons pointer (representing
|
||||||
// * its argument list) and a cons pointer (representing its environment) and a
|
* its argument list) and a cons pointer (representing its environment) and a
|
||||||
// * stack frame (representing the previous stack frame) as arguments and returns
|
* stack frame (representing the previous stack frame) as arguments and returns
|
||||||
// * a cons pointer (representing its result). */
|
* a cons pointer (representing its result). */
|
||||||
// struct pso_pointer ( *executable ) ( struct pso4*,
|
struct pso_pointer ( *executable ) ( struct pso4 *,
|
||||||
// struct pso_pointer,
|
struct pso_pointer,
|
||||||
// struct pso_pointer );
|
struct pso_pointer );
|
||||||
// };
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "memory/node.h"
|
#include "memory/node.h"
|
||||||
#include "memory/pso2.h"
|
#include "memory/pso.h"
|
||||||
#include "memory/pso4.h"
|
|
||||||
#include "payloads/stack.h"
|
#include "payloads/stack.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,6 @@
|
||||||
|
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
|
|
||||||
#define STACKTAG "STK"
|
|
||||||
#define STACKTV 4936787
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* number of arguments stored in a stack frame
|
* number of arguments stored in a stack frame
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@
|
||||||
#ifndef __psse_payloads_cons_h
|
#ifndef __psse_payloads_cons_h
|
||||||
#define __psse_payloads_cons_h
|
#define __psse_payloads_cons_h
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -26,7 +24,7 @@
|
||||||
* convenience, 14Bn years before 1st Jan 1970 (the UNIX epoch))
|
* convenience, 14Bn years before 1st Jan 1970 (the UNIX epoch))
|
||||||
*/
|
*/
|
||||||
struct time_payload {
|
struct time_payload {
|
||||||
unsigned __int128_t value;
|
unsigned __int128 value;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
* A pointer to an object in vector space.
|
* A pointer to an object in vector space.
|
||||||
*/
|
*/
|
||||||
#define VECTORPOINTTAG "VSP"
|
#define VECTORPOINTTAG "VSP"
|
||||||
#define VECTORPOINTTV 5264214
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief payload of a vector pointer cell.
|
* @brief payload of a vector pointer cell.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#ifndef __psse_payloads_write_stream_h
|
#ifndef __psse_payloads_write_stream_h
|
||||||
#define __psse_payloads_write_stream_h
|
#define __psse_payloads_write_stream_h
|
||||||
|
|
||||||
#include "io/fopen.h"
|
|
||||||
#include "memory/pointer.h"
|
#include "memory/pointer.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ int main( int argc, char *argv[] ) {
|
||||||
|
|
||||||
initialise_node( 0 );
|
initialise_node( 0 );
|
||||||
|
|
||||||
// repl( );
|
repl( );
|
||||||
|
|
||||||
exit( 0 );
|
exit( 0 );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "memory/memory.h"
|
#include "memory/memory.h"
|
||||||
#include "payloads/stack.h"
|
#include "memory/stack.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue