Rémi Bernon : ntdll: Move the main subheap after the free lists.

Alexandre Julliard julliard at winehq.org
Fri May 20 15:26:48 CDT 2022


Module: wine
Branch: master
Commit: f00da96a0112f101f20a5213aa6568bb72c8d7bd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f00da96a0112f101f20a5213aa6568bb72c8d7bd

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Sun May  1 17:48:06 2022 +0200

ntdll: Move the main subheap after the free lists.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/heap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 89c32fe4fa9..4425b0cd91e 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -186,7 +186,6 @@ typedef struct tagHEAP
     /* end of the Windows 10 compatible struct layout */
 
     BOOL             shared;        /* System shared heap */
-    SUBHEAP          subheap;       /* First sub-heap */
     struct list      entry;         /* Entry in process heap list */
     struct list      subheap_list;  /* Sub-heap list */
     struct list      large_list;    /* Large blocks list */
@@ -195,7 +194,8 @@ typedef struct tagHEAP
     DWORD            pending_pos;   /* Position in pending free requests ring */
     ARENA_INUSE    **pending_free;  /* Ring buffer for pending free requests */
     RTL_CRITICAL_SECTION cs;
-    FREE_LIST_ENTRY *freeList;      /* Free lists */
+    FREE_LIST_ENTRY  freeList[HEAP_NB_FREE_LISTS];
+    SUBHEAP          subheap;
 } HEAP;
 
 #define HEAP_MAGIC       ((DWORD)('H' | ('E'<<8) | ('A'<<16) | ('P'<<24)))
@@ -1008,8 +1008,6 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
 
         /* Build the free lists */
 
-        heap->freeList = (FREE_LIST_ENTRY *)((char *)heap + subheap->headerSize);
-        subheap->headerSize += HEAP_NB_FREE_LISTS * sizeof(FREE_LIST_ENTRY);
         list_init( &heap->freeList[0].arena.entry );
         for (i = 0, pEntry = heap->freeList; i < HEAP_NB_FREE_LISTS; i++, pEntry++)
         {




More information about the wine-cvs mailing list