3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-12 17:06:14 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-10-25 10:29:02 -07:00
parent 34e0e26e3d
commit 1ee2ba2a9b
17 changed files with 132 additions and 80 deletions

View file

@ -21,9 +21,33 @@ Revision History:
#ifdef Z3DEBUG
void region::display_mem_stats(std::ostream & out) const {
out << "num. objects: " << m_chuncks.size() << "\n";
out << "num. objects: " << m_chunks.size() << "\n";
}
void * region::allocate(size_t size) {
char * r = alloc_svect(char, size);
m_chunks.push_back(r);
return r;
}
void region::reset() {
for (auto* c : m_chunks)
dealloc_svect(c);
m_chunks.reset();
m_scopes.reset();
}
void region::pop_scope() {
unsigned old_size = m_scopes.back();
m_scopes.pop_back();
ptr_vector<char>::iterator it = m_chunks.begin() + old_size;
ptr_vector<char>::iterator end = m_chunks.end();
for (; it != end; ++it)
dealloc_svect(*it);
m_chunks.shrink(old_size);
}
#else
#include "util/tptr.h"