add missing members to stl allocator (#193)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <mimalloc.h>
|
||||
#include <new>
|
||||
#include <vector>
|
||||
|
||||
static void* p = malloc(8);
|
||||
|
||||
@@ -69,3 +70,18 @@ public:
|
||||
static Static s = Static();
|
||||
|
||||
|
||||
bool test_stl_allocator1() {
|
||||
std::vector<int, mi_stl_allocator<int>> vec;
|
||||
vec.push_back(1);
|
||||
vec.pop_back();
|
||||
return vec.size() == 0;
|
||||
}
|
||||
|
||||
bool test_stl_allocator2() {
|
||||
struct some_struct { int i; int j; double z; };
|
||||
|
||||
std::vector<some_struct, mi_stl_allocator<some_struct>> vec;
|
||||
vec.push_back(some_struct());
|
||||
vec.pop_back();
|
||||
return vec.size() == 0;
|
||||
}
|
||||
Reference in New Issue
Block a user