3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

merge useful utilities from qsat

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-03-19 12:01:44 -07:00
parent f951372f03
commit f175f864ec
32 changed files with 323 additions and 38 deletions

View file

@ -45,6 +45,7 @@ public:
bool contains(T1 * t1, T2 * t2) const { return m_set.contains(obj_pair(t1, t2)); }
bool contains(obj_pair const & p) const { return m_set.contains(p); }
void reset() { m_set.reset(); }
bool empty() const { return m_set.empty(); }
};
#endif

View file

@ -69,6 +69,7 @@ void small_object_allocator::reset() {
#define MASK ((1 << PTR_ALIGNMENT) - 1)
void small_object_allocator::deallocate(size_t size, void * p) {
if (size == 0) return;
#if defined(Z3DEBUG) && !defined(_WINDOWS)
// Valgrind friendly
memory::deallocate(p);
@ -91,6 +92,7 @@ void small_object_allocator::deallocate(size_t size, void * p) {
}
void * small_object_allocator::allocate(size_t size) {
if (size == 0) return 0;
#if defined(Z3DEBUG) && !defined(_WINDOWS)
// Valgrind friendly
return memory::allocate(size);