mirror of
https://github.com/Z3Prover/z3
synced 2025-08-03 18:00:23 +00:00
testing memory defragmentation, prefetch, delay ate
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
cd35caff52
commit
563f337997
17 changed files with 320 additions and 64 deletions
|
@ -135,12 +135,15 @@ namespace sat {
|
|||
m_allocator("clause-allocator") {
|
||||
}
|
||||
|
||||
void clause_allocator::finalize() {
|
||||
m_allocator.reset();
|
||||
}
|
||||
|
||||
clause * clause_allocator::get_clause(clause_offset cls_off) const {
|
||||
SASSERT(cls_off == reinterpret_cast<clause_offset>(reinterpret_cast<clause*>(cls_off)));
|
||||
return reinterpret_cast<clause *>(cls_off);
|
||||
}
|
||||
|
||||
|
||||
clause_offset clause_allocator::get_offset(clause const * cls) const {
|
||||
SASSERT(cls == reinterpret_cast<clause *>(reinterpret_cast<size_t>(cls)));
|
||||
return reinterpret_cast<size_t>(cls);
|
||||
|
@ -155,6 +158,18 @@ namespace sat {
|
|||
return cls;
|
||||
}
|
||||
|
||||
clause * clause_allocator::copy_clause(clause const& other) {
|
||||
size_t size = clause::get_obj_size(other.size());
|
||||
void * mem = m_allocator.allocate(size);
|
||||
clause * cls = new (mem) clause(m_id_gen.mk(), other.size(), other.m_lits, other.is_learned());
|
||||
cls->m_reinit_stack = other.on_reinit_stack();
|
||||
cls->m_glue = other.glue();
|
||||
cls->m_psm = other.psm();
|
||||
cls->m_frozen = other.frozen();
|
||||
cls->m_approx = other.approx();
|
||||
return cls;
|
||||
}
|
||||
|
||||
void clause_allocator::del_clause(clause * cls) {
|
||||
TRACE("sat_clause", tout << "delete: " << cls->id() << " " << *cls << "\n";);
|
||||
m_id_gen.recycle(cls->id());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue