Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
43ac858e
Commit
43ac858e
authored
May 03, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use block helpers in find_free_block.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
a436cc64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
heap.c
dlls/ntdll/heap.c
+7
-6
No files found.
dlls/ntdll/heap.c
View file @
43ac858e
...
...
@@ -1061,8 +1061,9 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
static
struct
block
*
find_free_block
(
HEAP
*
heap
,
SIZE_T
data_size
,
SUBHEAP
**
subheap
)
{
struct
list
*
ptr
=
&
find_free_list
(
heap
,
data_size
+
sizeof
(
ARENA_INUSE
),
FALSE
)
->
entry
;
SIZE_T
total_size
,
arena_size
;
struct
entry
*
entry
;
struct
block
*
block
;
SIZE_T
total_size
;
/* Find a suitable free list, and in it find a block large enough */
...
...
@@ -1070,13 +1071,13 @@ static struct block *find_free_block( HEAP *heap, SIZE_T data_size, SUBHEAP **su
{
entry
=
LIST_ENTRY
(
ptr
,
struct
entry
,
entry
);
if
(
entry
->
size
==
(
0
|
ARENA_FLAG_FREE
))
continue
;
arena_size
=
(
entry
->
size
&
ARENA_SIZE_MASK
)
+
sizeof
(
ARENA_FREE
)
-
sizeof
(
ARENA_INUSE
)
;
if
(
arena_size
>=
data_size
)
block
=
(
struct
block
*
)
entry
;
if
(
block_get_size
(
block
)
-
sizeof
(
*
block
)
>=
data_size
)
{
*
subheap
=
find_subheap
(
heap
,
(
struct
block
*
)
entry
,
FALSE
);
if
(
!
HEAP_Commit
(
*
subheap
,
(
struct
block
*
)
entry
,
data_size
))
return
NULL
;
*
subheap
=
find_subheap
(
heap
,
block
,
FALSE
);
if
(
!
HEAP_Commit
(
*
subheap
,
block
,
data_size
))
return
NULL
;
list_remove
(
&
entry
->
entry
);
return
(
struct
block
*
)
entry
;
return
block
;
}
}
...
...
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