fix(windows): guard el_mem_check with _WIN32 — rusage is POSIX-only #60
@@ -5880,6 +5880,10 @@ el_val_t getpid_now(void) {
|
|||||||
* Returns 0 always (the only non-return path is the exit() branch).
|
* Returns 0 always (the only non-return path is the exit() branch).
|
||||||
*/
|
*/
|
||||||
el_val_t el_mem_check(void) {
|
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. */
|
/* Read limit from env; default 512 MB. */
|
||||||
long limit_mb = 512;
|
long limit_mb = 512;
|
||||||
const char *env_val = getenv("ELC_MAX_MEM_MB");
|
const char *env_val = getenv("ELC_MAX_MEM_MB");
|
||||||
@@ -5905,6 +5909,7 @@ el_val_t el_mem_check(void) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── args() — command-line argument access ──────────────────────────────────
|
/* ── args() — command-line argument access ──────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user