add missing members to stl allocator (#193)

This commit is contained in:
daan 2020-01-20 15:27:05 -08:00
parent b77be05e40
commit 146899af8a
3 changed files with 56 additions and 19 deletions

View file

@ -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;
}