mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
add test for mimalloc override on Windows (issue #981)
This commit is contained in:
parent
5764845c4d
commit
1711a82756
6 changed files with 419 additions and 7 deletions
15
test/main-override-dep.cpp
Normal file
15
test/main-override-dep.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue