]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: init: remove the ifdef on HAPROXY_MEMMAX
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Feb 2022 16:15:02 +0000 (17:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Feb 2022 16:11:33 +0000 (17:11 +0100)
It's ugly, let's move it to defaults.h with all other ones and preset
it to zero if not defined.

include/haproxy/defaults.h
src/haproxy.c

index 9b521dff1fe7c7222ff07500bda37a35c6797086..8079d059dc05f23db771633c7e94c33543d82786 100644 (file)
 #define MEM_USABLE_RATIO 0.97
 #endif
 
+/* if not 0, maximum allocatable memory per process in MB */
+#ifndef HAPROXY_MEMMAX
+#define HAPROXY_MEMMAX 0
+#endif
+
 /* Pools are always enabled unless explicitly disabled. When disabled, the
  * calls are directly passed to the underlying OS functions.
  */
index 4d95ae6eb440ccce3400837e2c69ef593a61725c..6350a6aa7bb8d96a12a818539ee3f2afe9fa6f2b 100644 (file)
@@ -1513,10 +1513,7 @@ static void init(int argc, char **argv)
        totalconn = actconn = listeners = stopping = 0;
        killed = 0;
 
-
-#ifdef HAPROXY_MEMMAX
        global.rlimit_memmax_all = HAPROXY_MEMMAX;
-#endif
 
        tzset();
        clock_init_process_date();