ntdll: Store the pending free list in the main process heap.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9fd2330a96
commit
f5f1737456
|
@ -1508,14 +1508,9 @@ void heap_set_debug_flags( HANDLE handle )
|
||||||
if ((heap->flags & HEAP_GROWABLE) && !heap->pending_free &&
|
if ((heap->flags & HEAP_GROWABLE) && !heap->pending_free &&
|
||||||
((flags & HEAP_FREE_CHECKING_ENABLED) || RUNNING_ON_VALGRIND))
|
((flags & HEAP_FREE_CHECKING_ENABLED) || RUNNING_ON_VALGRIND))
|
||||||
{
|
{
|
||||||
void *ptr = NULL;
|
heap->pending_free = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||||
SIZE_T size = MAX_FREE_PENDING * sizeof(*heap->pending_free);
|
MAX_FREE_PENDING * sizeof(*heap->pending_free) );
|
||||||
|
heap->pending_pos = 0;
|
||||||
if (!virtual_alloc_aligned( &ptr, 0, &size, MEM_COMMIT, PAGE_READWRITE, 4 ))
|
|
||||||
{
|
|
||||||
heap->pending_free = ptr;
|
|
||||||
heap->pending_pos = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1622,12 +1617,7 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
|
||||||
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
|
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
|
||||||
}
|
}
|
||||||
subheap_notify_free_all(&heapPtr->subheap);
|
subheap_notify_free_all(&heapPtr->subheap);
|
||||||
if (heapPtr->pending_free)
|
RtlFreeHeap( GetProcessHeap(), 0, heapPtr->pending_free );
|
||||||
{
|
|
||||||
size = 0;
|
|
||||||
addr = heapPtr->pending_free;
|
|
||||||
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
|
|
||||||
}
|
|
||||||
size = 0;
|
size = 0;
|
||||||
addr = heapPtr->subheap.base;
|
addr = heapPtr->subheap.base;
|
||||||
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
|
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
|
||||||
|
|
Loading…
Reference in New Issue