Rémi Bernon : ntdll: Consistently use a heap local variable.
Alexandre Julliard
julliard at winehq.org
Wed May 25 16:51:46 CDT 2022
Module: wine
Branch: master
Commit: 2e4b637f26853a36773429c6de6feb105ffa4136
URL: https://source.winehq.org/git/wine.git/?a=commit;h=2e4b637f26853a36773429c6de6feb105ffa4136
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Sat Apr 30 00:09:54 2022 +0200
ntdll: Consistently use a heap local variable.
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;
}
More information about the wine-cvs
mailing list