|
x-engine-c v0.2.13
The C engine for x-lang
|
Navigate the base object's pair tree. More...
Macros | |
| #define | X_READ_BUF_SIZE 65536 |
Navigate the base object's pair tree.
x_eval_field_* macros return a field's stack cell (current . saved); read the current value with x_firstobj(). The x_eval_env, x_eval_ctrl, x_eval_io_state, and x_eval_state macros are the group anchors the fields hang off. x_base, io, meta, hooks, and heap come from x-base.h (x-expr).
| #define X_READ_BUF_SIZE 65536 |
Capacity of a base's READER buffer – the one the tokenizer reads through, hung off x_base_field_buffer.
ONE NUMBER FOR ALL OF THEM. x_base_field_buffer is a STACK: the base is constructed with one of these, and a reader may push another (a file read pushes one, and tokenizing a string pushes one sized exactly to the string). The constructed buffer is the bottom of that stack, so it is the default rather than the usual target – which is how it came to be 256 bytes in x_prim_make_base while the CLI gave the same field 65536, a 256x difference between two sites filling one slot, with only the larger one named.
Named for what it buffers rather than for who allocates it: the earlier name lived in x-cli.c, so nothing outside the CLI could reach it even to agree with it.
NOTE the buffer object records cursors (x_bufferval / x_bufferread / x_bufferwrite) but NOT capacity, so this bound is not available to the code that fills a buffer. One constant is the floor of fixing that, not the fix.
It used to have a sibling, X_ERROR_BUF_SIZE, sized for the same reason and kept separate so a change to one could not silently move the other. That one is gone: a raise no longer formats a message into a scratch buffer at all. It stores the message literal and the subject as two pointers in a typed ERR (x-type/err.c), which also retires the hazard that constant's comment was mostly about – the symbol was appended LAST, so an over-long message silently dropped the one detail worth reading, the name that was unbound. Nothing is concatenated now, so nothing can be truncated.