add test for mimalloc override on Windows (issue #981)

This commit is contained in:
daanx 2025-01-06 12:08:15 -08:00
parent 5764845c4d
commit 1711a82756
6 changed files with 419 additions and 7 deletions

View file

@ -0,0 +1,15 @@
// Issue #981: test overriding allocation in a DLL that is compiled independent of mimalloc.
// This is imported by the `mimalloc-test-override` project.
#include <string>
#include "main-override-dep.h"
std::string TestAllocInDll::GetString()
{
char* test = new char[128];
memset(test, 0, 128);
const char* t = "test";
memcpy(test, t, 4);
std::string r = test;
delete[] test;
return r;
}