diff --git a/src/util/rlimit.cpp b/src/util/rlimit.cpp index 9f6c692cc..bda06157d 100644 --- a/src/util/rlimit.cpp +++ b/src/util/rlimit.cpp @@ -20,7 +20,7 @@ Revision History: #include "common_msgs.h" reslimit::reslimit(): - m_cancel(false), + m_cancel(0), m_count(0), m_limit(0) { } @@ -29,7 +29,6 @@ uint64 reslimit::count() const { return m_count; } - bool reslimit::inc() { ++m_count; return m_cancel == 0 && (m_limit == 0 || m_count <= m_limit); @@ -46,7 +45,7 @@ void reslimit::push(unsigned delta_limit) { new_limit = 0; } m_limits.push_back(m_limit); - m_limit = m_limit==0?new_limit:std::min(new_limit, m_limit); + m_limit = m_limit==0 ? new_limit : std::min(new_limit, m_limit); m_cancel = 0; } @@ -71,14 +70,14 @@ char const* reslimit::get_cancel_msg() const { void reslimit::push_child(reslimit* r) { #pragma omp critical (reslimit_cancel) { - m_children.push_back(r); + m_children.push_back(r); } } void reslimit::pop_child() { #pragma omp critical (reslimit_cancel) { - m_children.pop_back(); + m_children.pop_back(); } } @@ -99,7 +98,7 @@ void reslimit::reset_cancel() { void reslimit::inc_cancel() { #pragma omp critical (reslimit_cancel) - { + { set_cancel(m_cancel+1); } } @@ -114,8 +113,8 @@ void reslimit::dec_cancel() { } } -void reslimit::set_cancel(unsigned f) { - m_cancel = f; +void reslimit::set_cancel(unsigned f) { + m_cancel = f; for (unsigned i = 0; i < m_children.size(); ++i) { m_children[i]->set_cancel(f); } diff --git a/src/util/rlimit.h b/src/util/rlimit.h index ac5db6136..913984768 100644 --- a/src/util/rlimit.h +++ b/src/util/rlimit.h @@ -29,8 +29,8 @@ class reslimit { ptr_vector m_children; void set_cancel(unsigned f); - -public: + +public: reslimit(); void push(unsigned delta_limit); void pop(); @@ -39,7 +39,7 @@ public: bool inc(); bool inc(unsigned offset); - uint64 count() const; + uint64 count() const; bool get_cancel_flag() const { return m_cancel > 0; }