From 6a0522395800018629152f1601d09ecfca273762 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Fri, 17 Oct 2025 16:43:05 -0400 Subject: [PATCH] Enhance comments in memory limit checking function Added comments to clarify memory limit checks. --- src/unix/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/unix/core.c b/src/unix/core.c index 17fe3021e..99f5fa3d0 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -2150,14 +2150,13 @@ int uv__sock_reuseport(int fd) { return 0; } - +/* Check if rlimit has any expressed restrictions on usable memory. */ uint64_t uv__get_rlimit_max_memory(void) { struct rlimit rl; uint64_t result = 0; uint64_t rlimit_value; #if defined(RLIMIT_AS) - /* Check RLIMIT_AS (virtual memory limit). */ if (getrlimit(RLIMIT_AS, &rl) == 0 && rl.rlim_cur != RLIM_INFINITY) { rlimit_value = rl.rlim_cur; result = rlimit_value; @@ -2165,7 +2164,6 @@ uint64_t uv__get_rlimit_max_memory(void) { #endif #if defined(RLIMIT_DATA) - /* Check RLIMIT_DATA (data segment limit). */ if (getrlimit(RLIMIT_DATA, &rl) == 0 && rl.rlim_cur != RLIM_INFINITY) { rlimit_value = rl.rlim_cur; if (result == 0 || rlimit_value < result)