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:
parent
c5cfd62e0a
commit
85db8163fa
4 changed files with 23 additions and 18 deletions
|
@ -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 {
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue