mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
Change rlim_t
to size_t
in setStackSize
in preparation of Windows impl
This commit is contained in:
parent
beb3c2bc7a
commit
e42d00c961
2 changed files with 4 additions and 4 deletions
|
@ -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<rlim_t>(stackSize), limit.rlim_max);
|
||||
if (setrlimit(RLIMIT_STACK, &limit) != 0) {
|
||||
logger->log(
|
||||
lvlError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue