aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-11-05 09:19:56 +0100
committerGitHub <noreply@github.com>2018-11-05 09:19:56 +0100
commit8f50f289b9d142828aa38a2d3338e8bf517b0258 (patch)
treeb0dc299184f7b654eafb2052fec6e13aa60076c6
parent36ea98385f30107369479d2e682c544863c4f1af (diff)
parent2b935421718c9a8d8f2183d9cb4a4973c078bcfa (diff)
downloadyosys-8f50f289b9d142828aa38a2d3338e8bf517b0258.tar.gz
yosys-8f50f289b9d142828aa38a2d3338e8bf517b0258.tar.bz2
yosys-8f50f289b9d142828aa38a2d3338e8bf517b0258.zip
Merge pull request #691 from arjenroodselaar/stacksize
Use conservative stack size for SMT2 on MacOS
-rw-r--r--backends/smt2/smtio.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py
index 3fc823e3e..e8ed5e63b 100644
--- a/backends/smt2/smtio.py
+++ b/backends/smt2/smtio.py
@@ -32,10 +32,15 @@ from threading import Thread
if os.name == "posix":
smtio_reclimit = 64 * 1024
smtio_stacksize = 128 * 1024 * 1024
+ smtio_stacklimit = resource.RLIM_INFINITY
+ if os.uname().sysname == "Darwin":
+ # MacOS has rather conservative stack limits
+ smtio_stacksize = 16 * 1024 * 1024
+ smtio_stacklimit = resource.getrlimit(resource.RLIMIT_STACK)[1]
if sys.getrecursionlimit() < smtio_reclimit:
sys.setrecursionlimit(smtio_reclimit)
if resource.getrlimit(resource.RLIMIT_STACK)[0] < smtio_stacksize:
- resource.setrlimit(resource.RLIMIT_STACK, (smtio_stacksize, -1))
+ resource.setrlimit(resource.RLIMIT_STACK, (smtio_stacksize, smtio_stacklimit))
# currently running solvers (so we can kill them)