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
d0ad5d6a
Commit
d0ad5d6a
authored
May 24, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use block helpers in free_used_block.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
a87d0211
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
heap.c
dlls/ntdll/heap.c
+8
-12
No files found.
dlls/ntdll/heap.c
View file @
d0ad5d6a
...
...
@@ -720,39 +720,35 @@ static void free_used_block( SUBHEAP *subheap, struct block *block )
heap
->
pending_free
[
heap
->
pending_pos
]
=
block
;
heap
->
pending_pos
=
(
heap
->
pending_pos
+
1
)
%
MAX_FREE_PENDING
;
block_set_type
(
block
,
ARENA_PENDING_MAGIC
);
mark_block_free
(
block
+
1
,
block
->
size
&
ARENA_SIZE_MASK
,
heap
->
flags
);
mark_block_free
(
block
+
1
,
block
_get_size
(
block
)
-
sizeof
(
*
block
)
,
heap
->
flags
);
if
(
!
(
block
=
tmp
)
||
!
(
subheap
=
find_subheap
(
heap
,
block
,
FALSE
)))
return
;
}
block_size
=
(
block
->
size
&
ARENA_SIZE_MASK
)
+
sizeof
(
*
block
);
if
(
block
->
size
&
ARENA_FLAG_PREV_FREE
)
block_size
=
block_get_size
(
block
);
if
(
block
_get_flags
(
block
)
&
ARENA_FLAG_PREV_FREE
)
{
/* merge with previous block if it is free */
block
=
*
((
struct
block
**
)
block
-
1
);
block_size
+=
(
block
->
size
&
ARENA_SIZE_MASK
)
+
sizeof
(
*
entry
);
block_size
+=
block_get_size
(
block
);
entry
=
(
struct
entry
*
)
block
;
list_remove
(
&
entry
->
entry
);
}
else
entry
=
(
struct
entry
*
)
block
;
create_free_block
(
subheap
,
block
,
block_size
);
block_size
=
(
block
->
size
&
ARENA_SIZE_MASK
)
+
sizeof
(
*
entry
);
if
((
char
*
)
block
+
block_size
<
(
char
*
)
subheap
->
base
+
subheap
->
size
)
return
;
/* not the last block */
if
(
next_block
(
subheap
,
block
))
return
;
/* not the last block */
if
(((
char
*
)
block
==
(
char
*
)
subheap
->
base
+
subheap
->
headerSize
)
&&
(
subheap
!=
&
subheap
->
heap
->
subheap
))
if
(
block
==
first_block
(
subheap
)
&&
subheap
!=
&
heap
->
subheap
)
{
/* free the subheap if it's empty and not the main one */
void
*
addr
=
subheap
->
base
;
void
*
addr
=
subheap
_base
(
subheap
)
;
SIZE_T
size
=
0
;
list_remove
(
&
entry
->
entry
);
list_remove
(
&
subheap
->
entry
);
NtFreeVirtualMemory
(
NtCurrentProcess
(),
&
addr
,
&
size
,
MEM_RELEASE
);
return
;
}
if
(
!
heap
->
shared
)
HEAP_Decommit
(
subheap
,
entry
+
1
);
else
if
(
!
heap
->
shared
)
HEAP_Decommit
(
subheap
,
entry
+
1
);
}
...
...
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