3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00

adding rlimit resource limit facility to provide platform and architecture independent method for canceling activities. This is to address issue #216

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-09-28 13:40:54 -07:00
parent 9b3e242990
commit f3b8fe130a

View file

@ -38,9 +38,9 @@ bool reslimit::inc(unsigned offset) {
} }
void reslimit::push(unsigned delta_limit) { void reslimit::push(unsigned delta_limit) {
unsigned new_limit = UINT_MAX; unsigned new_limit = delta_limit + m_count;
if (delta_limit > 0 && delta_limit + m_count > m_count) { if (new_limit <= m_count) {
new_limit = delta_limit + m_count; new_limit = UINT_MAX;
} }
m_limits.push_back(m_limit); m_limits.push_back(m_limit);
m_limit = std::min(new_limit, m_limit); m_limit = std::min(new_limit, m_limit);