From cec7bfb54dbc624f781f0fbefec59f3c9ce666b1 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Mon, 30 Aug 2010 18:30:39 +0000 Subject: 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 --- tests/allocator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3