diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-11-07 15:32:34 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-11-07 15:32:34 +0100 |
commit | b54bf7c0f9720526dffce684ef1353b81f99547c (patch) | |
tree | 30486253c2cbad84cfe32928b8028fee72135820 /backends/smt2/smtio.py | |
parent | 4c50e3abb9b39fe088cc0a08c63fcadb8abdabb7 (diff) | |
download | yosys-b54bf7c0f9720526dffce684ef1353b81f99547c.tar.gz yosys-b54bf7c0f9720526dffce684ef1353b81f99547c.tar.bz2 yosys-b54bf7c0f9720526dffce684ef1353b81f99547c.zip |
Limit stack size to 16 MB on Darwin
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'backends/smt2/smtio.py')
-rw-r--r-- | backends/smt2/smtio.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py index 108f6bcfe..afbcf1fc4 100644 --- a/backends/smt2/smtio.py +++ b/backends/smt2/smtio.py @@ -34,9 +34,12 @@ if os.name == "posix": if sys.getrecursionlimit() < smtio_reclimit: sys.setrecursionlimit(smtio_reclimit) - smtio_stacksize = 128 * 1024 * 1024 current_rlimit_stack = resource.getrlimit(resource.RLIMIT_STACK) if current_rlimit_stack[0] != resource.RLIM_INFINITY: + smtio_stacksize = 128 * 1024 * 1024 + if os.uname().sysname == "Darwin": + # MacOS has rather conservative stack limits + smtio_stacksize = 16 * 1024 * 1024 if current_rlimit_stack[1] != resource.RLIM_INFINITY: smtio_stacksize = min(smtio_stacksize, current_rlimit_stack[1]) if current_rlimit_stack[0] < smtio_stacksize: |