[ion/src/simulator] Don't try to setrlimit on Windows

This commit is contained in:
Romain Goyet
2019-10-01 15:50:38 +02:00
committed by Ecco
parent dcede42c38
commit 03c4574e7b

View File

@@ -8,8 +8,10 @@
#include <ion/timing.h>
#include <ion/events.h>
#include <stdlib.h>
#ifndef __WIN32__
#include <signal.h>
#include <sys/resource.h>
#endif
constexpr int kHeapSize = 131072;
constexpr int kStackSize = 32768;
@@ -34,12 +36,14 @@ int main(int argc, char * argv[]) {
}
}
#ifndef __WIN32__
// Handle signals
signal(SIGABRT, Ion::Simulator::Events::dumpEventCount);
// Limit stack usage
struct rlimit stackLimits = {kStackSize, kStackSize};
setrlimit(RLIMIT_STACK, &stackLimits);
#endif
ion_main(argc, argv);
return 0;