ntdll: Store the pending free list in the main process heap.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Alexandre Julliard 2020-04-28 11:28:43 +02:00
parent 9fd2330a96
commit f5f1737456
1 changed files with 4 additions and 14 deletions

View File

@ -1508,14 +1508,9 @@ void heap_set_debug_flags( HANDLE handle )
if ((heap->flags & HEAP_GROWABLE) && !heap->pending_free &&
((flags & HEAP_FREE_CHECKING_ENABLED) || RUNNING_ON_VALGRIND))
{
void *ptr = NULL;
SIZE_T size = MAX_FREE_PENDING * sizeof(*heap->pending_free);
if (!virtual_alloc_aligned( &ptr, 0, &size, MEM_COMMIT, PAGE_READWRITE, 4 ))
{
heap->pending_free = ptr;
heap->pending_pos = 0;
}
heap->pending_free = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY,
MAX_FREE_PENDING * sizeof(*heap->pending_free) );
heap->pending_pos = 0;
}
}
@ -1622,12 +1617,7 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
}
subheap_notify_free_all(&heapPtr->subheap);
if (heapPtr->pending_free)
{
size = 0;
addr = heapPtr->pending_free;
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );
}
RtlFreeHeap( GetProcessHeap(), 0, heapPtr->pending_free );
size = 0;
addr = heapPtr->subheap.base;
NtFreeVirtualMemory( NtCurrentProcess(), &addr, &size, MEM_RELEASE );