Merge branch 'dev' into dev2

This commit is contained in:
daanx 2025-01-06 12:08:43 -08:00
commit 248d8aad71
10 changed files with 456 additions and 33 deletions

View file

@ -9,16 +9,11 @@
#include <vector>
#include <future>
#include <iostream>
#include <thread>
//#include <mimalloc.h>
#include <assert.h>
#ifdef _WIN32
#include <mimalloc-new-delete.h>
#endif
#ifdef _WIN32
#include <windows.h>
static void msleep(unsigned long msecs) { Sleep(msecs); }
#else
@ -45,11 +40,19 @@ static void test_thread_local(); // issue #944
static void test_mixed1(); // issue #942
static void test_stl_allocators();
#if _WIN32
#include "main-override-dep.h"
static void test_dep(); // issue #981: test overriding in another DLL
#else
static void test_dep() { };
#endif
int main() {
mi_stats_reset(); // ignore earlier allocations
various_tests();
test_mixed1();
test_dep();
//test_std_string();
//test_thread_local();
@ -144,6 +147,16 @@ static bool test_stl_allocator1() {
struct some_struct { int i; int j; double z; };
#if _WIN32
static void test_dep()
{
TestAllocInDll t;
std::string s = t.GetString();
}
#endif
static bool test_stl_allocator2() {
std::vector<some_struct, mi_stl_allocator<some_struct> > vec;
vec.push_back(some_struct());