From 93d36fddb1a85dbd74c03e632ca09082fde0571c Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Thu, 25 Jun 2026 11:45:36 -0500 Subject: [PATCH] =?UTF-8?q?fix(windows):=20guard=20el=5Fmem=5Fcheck=20with?= =?UTF-8?q?=20=5FWIN32=20=E2=80=94=20rusage=20is=20POSIX-only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/el-compiler/runtime/el_runtime.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lang/el-compiler/runtime/el_runtime.c b/lang/el-compiler/runtime/el_runtime.c index d00b7d7..12a2075 100644 --- a/lang/el-compiler/runtime/el_runtime.c +++ b/lang/el-compiler/runtime/el_runtime.c @@ -5880,6 +5880,10 @@ el_val_t getpid_now(void) { * Returns 0 always (the only non-return path is the exit() branch). */ el_val_t el_mem_check(void) { +#ifdef _WIN32 + /* getrusage is POSIX-only — memory guard disabled on Windows. */ + return 0; +#else /* Read limit from env; default 512 MB. */ long limit_mb = 512; const char *env_val = getenv("ELC_MAX_MEM_MB"); @@ -5905,6 +5909,7 @@ el_val_t el_mem_check(void) { exit(1); } return 0; +#endif } /* ── args() — command-line argument access ──────────────────────────────────