From 715ce5dbe987c103eeebbda470325866dc614b16 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 21 Dec 2023 15:51:55 +0100 Subject: Introduce new BOX64_MAXCPU to cap the number of cpu core exposed, and created profile for wine, wine64 and GridAutosport using it --- src/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index db33d9a2..bb8181dd 100644 --- a/src/main.c +++ b/src/main.c @@ -49,6 +49,7 @@ int box64_nosandbox = 0; int box64_inprocessgpu = 0; int box64_malloc_hack = 0; int box64_dynarec_test = 0; +int box64_maxcpu = 0; #ifdef DYNAREC int box64_dynarec = 1; int box64_dynarec_dump = 0; @@ -971,6 +972,19 @@ void LoadLogEnv() if(box64_showbt) printf_log(LOG_INFO, "Show a Backtrace when a Segfault signal is caught\n"); } + p = getenv("BOX64_MAXCPU"); + if(p) { + int maxcpu = 0; + if(sscanf(p, "%d", &maxcpu)==1) + box64_maxcpu = maxcpu; + if(box64_maxcpu<0) + box64_maxcpu = 0; + if(box64_maxcpu) { + printf_log(LOG_NONE, "Will not expose more than %d cpu cores\n", box64_maxcpu); + } else { + printf_log(LOG_NONE, "Will not limit the number of cpu cores exposed\n"); + } + } box64_pagesize = sysconf(_SC_PAGESIZE); if(!box64_pagesize) box64_pagesize = 4096; -- cgit 1.4.1