From e42d00c961ad948c80c27f49d58316a7eae5e728 Mon Sep 17 00:00:00 2001 From: PoweredByPie Date: Sat, 18 May 2024 04:09:56 -0700 Subject: [PATCH] Change `rlim_t` to `size_t` in `setStackSize` in preparation of Windows impl --- src/libutil/current-process.cc | 6 +++--- src/libutil/current-process.hh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libutil/current-process.cc b/src/libutil/current-process.cc index c88013b3c..b252bd4d0 100644 --- a/src/libutil/current-process.cc +++ b/src/libutil/current-process.cc @@ -60,14 +60,14 @@ unsigned int getMaxCPU() #ifndef _WIN32 -rlim_t savedStackSize = 0; +size_t savedStackSize = 0; -void setStackSize(rlim_t stackSize) +void setStackSize(size_t stackSize) { struct rlimit limit; if (getrlimit(RLIMIT_STACK, &limit) == 0 && limit.rlim_cur < stackSize) { savedStackSize = limit.rlim_cur; - limit.rlim_cur = std::min(stackSize, limit.rlim_max); + limit.rlim_cur = std::min(static_cast(stackSize), limit.rlim_max); if (setrlimit(RLIMIT_STACK, &limit) != 0) { logger->log( lvlError, diff --git a/src/libutil/current-process.hh b/src/libutil/current-process.hh index a5adb70cf..8db4ada0d 100644 --- a/src/libutil/current-process.hh +++ b/src/libutil/current-process.hh @@ -21,7 +21,7 @@ unsigned int getMaxCPU(); /** * Change the stack size. */ -void setStackSize(rlim_t stackSize); +void setStackSize(size_t stackSize); #endif /**