3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-09-05 17:47:41 +00:00

move allocator to memory_manager and std_vector to vector

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-09-19 13:57:28 -07:00
parent c5cfd62e0a
commit 85db8163fa
4 changed files with 23 additions and 18 deletions

View file

@ -128,6 +128,19 @@ void dealloc_svect(T * ptr) {
memory::deallocate(ptr);
}
template <typename T>
struct std_allocator {
using value_type = T;
T* allocate(std::size_t n) {
return static_cast<T*>(memory::allocate(n * sizeof(T)));
}
void deallocate(T* p, std::size_t n) {
memory::deallocate(p);
}
};
struct mem_stat {
};

View file

@ -33,6 +33,7 @@ Revision History:
#include "util/memory_manager.h"
#include "util/hash.h"
#include "util/z3_exception.h"
#include <vector>
// disable warning for constant 'if' expressions.
// these are used heavily in templates.
@ -40,6 +41,8 @@ Revision History:
#pragma warning(disable:4127)
#endif
template <typename T>
class std_vector : public std::vector<T, std_allocator<T>> {};
#if 0