summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-30 18:30:39 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-30 18:30:39 +0000
commitcec7bfb54dbc624f781f0fbefec59f3c9ce666b1 (patch)
treec721b6adf9ea6ce0baab64fe3e47fec6a7aa8bd7
parentbfbf61ba938554f9265cccee01f9f6b62ea6d534 (diff)
tests: Custom allocations now use memory from Win32 heap instead of CRT heap
git-svn-id: http://pugixml.googlecode.com/svn/trunk@711 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--tests/allocator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/allocator.cpp b/tests/allocator.cpp
index a1a0351..b90820e 100644
--- a/tests/allocator.cpp
+++ b/tests/allocator.cpp
@@ -28,7 +28,10 @@ namespace
void* allocate_page_aligned(size_t size)
{
// We can't use VirtualAlloc because it has 64Kb granularity so we run out of address space quickly
- void* result = malloc(size + PAGE_SIZE);
+ // We can't use malloc because of occasional problems with CW on CRT termination
+ static HANDLE heap = HeapCreate(0, 0, 0);
+
+ void* result = HeapAlloc(heap, 0, size + PAGE_SIZE);
return (void*)align_to_page((size_t)result);
}