mirror of https://github.com/vitalif/openscad
Implemented stackLimit() for Mac OS X
parent
d8010a0659
commit
15835271c2
|
@ -20,7 +20,19 @@ std::string PlatformUtils::userConfigPath()
|
||||||
|
|
||||||
unsigned long PlatformUtils::stackLimit()
|
unsigned long PlatformUtils::stackLimit()
|
||||||
{
|
{
|
||||||
return STACK_LIMIT_DEFAULT;
|
struct rlimit limit;
|
||||||
|
|
||||||
|
int ret = getrlimit(RLIMIT_STACK, &limit);
|
||||||
|
if (ret == 0) {
|
||||||
|
if (limit.rlim_cur > STACK_BUFFER_SIZE) {
|
||||||
|
return limit.rlim_cur - STACK_BUFFER_SIZE;
|
||||||
|
}
|
||||||
|
if (limit.rlim_max > STACK_BUFFER_SIZE) {
|
||||||
|
return limit.rlim_max - STACK_BUFFER_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return STACK_LIMIT_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlatformUtils::ensureStdIO(void) {}
|
void PlatformUtils::ensureStdIO(void) {}
|
||||||
|
|
Loading…
Reference in New Issue