parent
1b57825524
commit
cd44c0af71
1 changed files with 15 additions and 0 deletions
|
@ -17,6 +17,10 @@
|
|||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#if __linux__
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
extern std::string chrootHelperName;
|
||||
|
@ -325,6 +329,17 @@ void mainWrapped(int argc, char * * argv)
|
|||
|
||||
int main(int argc, char * * argv)
|
||||
{
|
||||
// Increase the default stack size for the evaluator and for
|
||||
// libstdc++'s std::regex.
|
||||
#if __linux__
|
||||
rlim_t stackSize = 64 * 1024 * 1024;
|
||||
struct rlimit limit;
|
||||
if (getrlimit(RLIMIT_STACK, &limit) == 0 && limit.rlim_cur < stackSize) {
|
||||
limit.rlim_cur = stackSize;
|
||||
setrlimit(RLIMIT_STACK, &limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
return nix::handleExceptions(argv[0], [&]() {
|
||||
nix::mainWrapped(argc, argv);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue