Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
47f7dfcc
Commit
47f7dfcc
authored
May 03, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Remove entries from the free list in HEAP_FindFreeBlock.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1bb92df7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
heap.c
dlls/ntdll/heap.c
+8
-9
No files found.
dlls/ntdll/heap.c
View file @
47f7dfcc
...
@@ -1067,23 +1067,24 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
...
@@ -1067,23 +1067,24 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
static
ARENA_FREE
*
HEAP_FindFreeBlock
(
HEAP
*
heap
,
SIZE_T
data_size
,
SUBHEAP
**
ppSubHeap
)
static
ARENA_FREE
*
HEAP_FindFreeBlock
(
HEAP
*
heap
,
SIZE_T
data_size
,
SUBHEAP
**
ppSubHeap
)
{
{
struct
entry
*
entry
=
find_free_list
(
heap
,
data_size
+
sizeof
(
ARENA_INUSE
),
FALSE
);
struct
entry
*
entry
=
find_free_list
(
heap
,
data_size
+
sizeof
(
ARENA_INUSE
),
FALSE
);
SIZE_T
total_size
,
arena_size
;
ARENA_FREE
*
pArena
;
SUBHEAP
*
subheap
;
SUBHEAP
*
subheap
;
struct
list
*
ptr
;
struct
list
*
ptr
;
SIZE_T
total_size
;
/* Find a suitable free list, and in it find a block large enough */
/* Find a suitable free list, and in it find a block large enough */
ptr
=
&
entry
->
entry
;
ptr
=
&
entry
->
entry
;
while
((
ptr
=
list_next
(
&
heap
->
freeList
[
0
].
arena
.
entry
,
ptr
)))
while
((
ptr
=
list_next
(
&
heap
->
freeList
[
0
].
arena
.
entry
,
ptr
)))
{
{
ARENA_FREE
*
pArena
=
LIST_ENTRY
(
ptr
,
ARENA_FREE
,
entry
);
pArena
=
LIST_ENTRY
(
ptr
,
ARENA_FREE
,
entry
);
SIZE_T
arena_size
=
(
pArena
->
size
&
ARENA_SIZE_MASK
)
+
arena_size
=
(
pArena
->
size
&
ARENA_SIZE_MASK
)
+
sizeof
(
ARENA_FREE
)
-
sizeof
(
ARENA_INUSE
);
sizeof
(
ARENA_FREE
)
-
sizeof
(
ARENA_INUSE
);
if
(
arena_size
>=
data_size
)
if
(
arena_size
>=
data_size
)
{
{
subheap
=
find_subheap
(
heap
,
(
struct
block
*
)
pArena
,
FALSE
);
subheap
=
find_subheap
(
heap
,
(
struct
block
*
)
pArena
,
FALSE
);
if
(
!
HEAP_Commit
(
subheap
,
(
ARENA_INUSE
*
)
pArena
,
data_size
))
return
NULL
;
if
(
!
HEAP_Commit
(
subheap
,
(
ARENA_INUSE
*
)
pArena
,
data_size
))
return
NULL
;
*
ppSubHeap
=
subheap
;
*
ppSubHeap
=
subheap
;
list_remove
(
&
pArena
->
entry
);
return
pArena
;
return
pArena
;
}
}
}
}
...
@@ -1120,7 +1121,9 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T data_size, SUBHEAP **p
...
@@ -1120,7 +1121,9 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T data_size, SUBHEAP **p
subheap
,
subheap
->
size
,
heap
);
subheap
,
subheap
->
size
,
heap
);
*
ppSubHeap
=
subheap
;
*
ppSubHeap
=
subheap
;
return
(
ARENA_FREE
*
)((
char
*
)
subheap
->
base
+
subheap
->
headerSize
);
pArena
=
(
ARENA_FREE
*
)((
char
*
)
subheap
->
base
+
subheap
->
headerSize
);
list_remove
(
&
pArena
->
entry
);
return
pArena
;
}
}
...
@@ -1553,10 +1556,6 @@ static NTSTATUS heap_allocate( HEAP *heap, ULONG flags, SIZE_T size, void **ret
...
@@ -1553,10 +1556,6 @@ static NTSTATUS heap_allocate( HEAP *heap, ULONG flags, SIZE_T size, void **ret
if
(
!
(
entry
=
HEAP_FindFreeBlock
(
heap
,
data_size
,
&
subheap
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
entry
=
HEAP_FindFreeBlock
(
heap
,
data_size
,
&
subheap
)))
return
STATUS_NO_MEMORY
;
/* Remove the arena from the free list */
list_remove
(
&
entry
->
entry
);
/* Build the in-use arena */
/* Build the in-use arena */
block
=
(
struct
block
*
)
entry
;
block
=
(
struct
block
*
)
entry
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment