aboutsummaryrefslogtreecommitdiffstats
path: root/src/compile.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-25 13:27:11 +0100
committereunhhu <[email protected]>2026-09-25 13:27:11 +0100
commitb4ec5eeaab82ee7c876f7d02e6430997f7240899 (patch)
treefbd5918bf22b925b16aea3eb8a4b2ab060100c10 /src/compile.c
parentc61aff54852d6f2fa63949950022e7a8ede1896c (diff)
downloadaup-b4ec5eeaab82ee7c876f7d02e6430997f7240899.tar.gz
aup-b4ec5eeaab82ee7c876f7d02e6430997f7240899.zip
Emit Pure module format v4
Pure now loads only v4 modules. The new header counts records, which aup does not declare yet, so the output changes only in its magic.
Diffstat (limited to 'src/compile.c')
-rw-r--r--src/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compile.c b/src/compile.c
index e95d16c..340e623 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <string.h>
-/* Limits and opcodes of Pure module format v3. */
+/* Limits and opcodes of Pure module format v4. */
enum { STATES = 32, INPUTS = 32, VIEWS = 24, HANDLERS = 64, CODE = 512, STACK = 64, NAME = 32,
DEPTH = 64, FIELDS = 32, COLLECTIONS = 1, CONSTANTS = 64, CONSTANT_BYTES = 8192 };
enum { CONST, LOAD, DT, ADD, SUB, MUL, DIV, NEG, LT, LE, GT, GE, EQ, NE, AND, OR, NOT,
@@ -1175,7 +1175,7 @@ static void generate(Compiler *c, unsigned char **module, size_t *size) {
*size = 40 + 16u * c->states + 12u * c->collections + 16u * c->input_count + 8u * fields + 8u * c->constants +
16u * c->views + 12u * c->handler_count + 16u * c->code_count + used + c->constant_used;
unsigned char *p = *module = allocate(c, *size);
- memcpy(p, "PUREMOD3", 8);
+ memcpy(p, "PUREMOD4", 8);
put16(p + 8, c->states);
put16(p + 10, c->input_count);
put16(p + 12, c->views);