commit 455667f35b962f3ef09f2aa17490c4afc458fc6b
parent e2b9951654ab6ba3250b936f286753bb0ca5e274
Author: Ryan Sepassi <rsepassi@gmail.com>
Date: Fri, 24 Apr 2026 12:06:44 -0700
Bump M1PP macro cap from 256 to 512
Raise MAX_MACROS in the host C expander and M1PP_MACROS_CAP in the
self-hosted m1pp.P1 (byte cap doubled to 0x25000 for 512 × 296-byte
records). amd64 backend + P1 frontend + libp1pp together exceed 256.
Diffstat:
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/M1PP.md b/docs/M1PP.md
@@ -229,7 +229,7 @@ Fixed at compile time:
| source tokens | 65536 |
| macro body tokens | 65536 |
| expansion pool tokens | 65536 |
-| macros | 256 |
+| macros | 512 |
| parameters per macro | 16 |
| stream stack depth | 64 |
| expression frames | 256 |
diff --git a/m1pp/m1pp.P1 b/m1pp/m1pp.P1
@@ -32,12 +32,12 @@ DEFINE M1PP_OUTPUT_CAP 0000010000000000
DEFINE M1PP_TEXT_CAP 0080000000000000
DEFINE M1PP_TOKENS_END 0080010000000000
## Macro record is 296 bytes: name (16) + param_count (8) + params[16]*16 (256)
-## + body_start (8) + body_end (8). MACROS_CAP fits 256 records (75776 B).
+## + body_start (8) + body_end (8). MACROS_CAP fits 512 records (151552 B).
## Body-token arena fits 4096 tokens (98304 B = 0x18000).
DEFINE M1PP_MACRO_RECORD_SIZE 2801000000000000
DEFINE M1PP_MACRO_BODY_START_OFF 1801000000000000
DEFINE M1PP_MACRO_BODY_END_OFF 2001000000000000
-DEFINE M1PP_MACROS_CAP 0028010000000000
+DEFINE M1PP_MACROS_CAP 0050020000000000
DEFINE M1PP_MACRO_BODY_CAP 0080010000000000
DEFINE O_WRONLY_CREAT_TRUNC 4102000000000000
DEFINE MODE_0644 A401000000000000
diff --git a/m1pp/m1pp.c b/m1pp/m1pp.c
@@ -71,7 +71,7 @@
#define MAX_OUTPUT 524288
#define MAX_TEXT 524288
#define MAX_TOKENS 65536
-#define MAX_MACROS 256
+#define MAX_MACROS 512
#define MAX_PARAMS 16
#define MAX_MACRO_BODY_TOKENS MAX_TOKENS
#define MAX_EXPAND 65536