[PATCH 1/6] ntdll: Consistently use a heap local variable.
Rémi Bernon
wine at gitlab.winehq.org
Wed May 25 02:59:57 CDT 2022
From: Rémi Bernon <rbernon at codeweavers.com>
Instead of subheap->heap.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/ntdll/heap.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 540625bff27..15b708f66c2 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -1393,6 +1393,7 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
PVOID unknown, PRTL_HEAP_DEFINITION definition )
{
SUBHEAP *subheap;
+ HEAP *heap;
/* Allocate the heap block */
@@ -1402,24 +1403,24 @@ HANDLE WINAPI RtlCreateHeap( ULONG flags, PVOID addr, SIZE_T totalSize, SIZE_T c
if (!totalSize) totalSize = HEAP_DEF_SIZE;
if (!(subheap = HEAP_CreateSubHeap( NULL, addr, flags, commitSize, totalSize ))) return 0;
+ heap = subheap->heap;
- heap_set_debug_flags( subheap->heap );
+ heap_set_debug_flags( heap );
/* link it into the per-process heap list */
if (processHeap)
{
- HEAP *heapPtr = subheap->heap;
RtlEnterCriticalSection( &processHeap->cs );
- list_add_head( &processHeap->entry, &heapPtr->entry );
+ list_add_head( &processHeap->entry, &heap->entry );
RtlLeaveCriticalSection( &processHeap->cs );
}
else if (!addr)
{
- processHeap = subheap->heap; /* assume the first heap we create is the process main heap */
+ processHeap = heap; /* assume the first heap we create is the process main heap */
list_init( &processHeap->entry );
}
- return subheap->heap;
+ return heap;
}
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/128
More information about the wine-devel
mailing list