mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
fix highest allocated page for arena unload
This commit is contained in:
parent
7b8a710774
commit
a7370dcbd2
4 changed files with 24 additions and 6 deletions
|
@ -12,4 +12,14 @@ std::string TestAllocInDll::GetString()
|
|||
std::string r = test;
|
||||
delete[] test;
|
||||
return r;
|
||||
}
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
void TestAllocInDll::TestHeapAlloc()
|
||||
{
|
||||
HANDLE heap = GetProcessHeap();
|
||||
int* p = (int*)HeapAlloc(heap, 0, sizeof(int));
|
||||
*p = 42;
|
||||
HeapFree(heap, 0, p);
|
||||
}
|
|
@ -8,4 +8,5 @@ class TestAllocInDll
|
|||
{
|
||||
public:
|
||||
__declspec(dllexport) std::string GetString();
|
||||
__declspec(dllexport) void TestHeapAlloc();
|
||||
};
|
||||
|
|
|
@ -37,7 +37,7 @@ static void test_thread_local(); // issue #944
|
|||
static void test_mixed1(); // issue #942
|
||||
static void test_stl_allocators();
|
||||
|
||||
#if x_WIN32
|
||||
#if _WIN32
|
||||
#include "main-override-dep.h"
|
||||
static void test_dep(); // issue #981: test overriding in another DLL
|
||||
#else
|
||||
|
@ -46,8 +46,8 @@ static void test_dep() { };
|
|||
|
||||
int main() {
|
||||
mi_stats_reset(); // ignore earlier allocations
|
||||
various_tests();
|
||||
test_mixed1();
|
||||
//various_tests();
|
||||
//test_mixed1();
|
||||
|
||||
test_dep();
|
||||
|
||||
|
@ -145,11 +145,13 @@ static bool test_stl_allocator1() {
|
|||
struct some_struct { int i; int j; double z; };
|
||||
|
||||
|
||||
#if x_WIN32
|
||||
#if _WIN32
|
||||
static void test_dep()
|
||||
{
|
||||
TestAllocInDll t;
|
||||
std::string s = t.GetString();
|
||||
|
||||
t.TestHeapAlloc();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue