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
a51e2a3f
Commit
a51e2a3f
authored
Nov 14, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move delayed free support out of heap_free.
parent
cbe3fb89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
heap.c
dlls/ntdll/heap.c
+23
-10
No files found.
dlls/ntdll/heap.c
View file @
a51e2a3f
...
...
@@ -749,22 +749,33 @@ static void create_free_block( struct heap *heap, ULONG flags, SUBHEAP *subheap,
}
static
struct
block
*
heap_delay_free
(
struct
heap
*
heap
,
ULONG
flags
,
struct
block
*
block
)
{
struct
block
*
tmp
;
if
(
!
heap
->
pending_free
)
return
block
;
block_set_type
(
block
,
BLOCK_TYPE_DEAD
);
mark_block_free
(
block
+
1
,
block_get_size
(
block
)
-
sizeof
(
*
block
),
flags
);
heap_lock
(
heap
,
flags
);
tmp
=
heap
->
pending_free
[
heap
->
pending_pos
];
heap
->
pending_free
[
heap
->
pending_pos
]
=
block
;
heap
->
pending_pos
=
(
heap
->
pending_pos
+
1
)
%
MAX_FREE_PENDING
;
heap_unlock
(
heap
,
flags
);
return
tmp
;
}
static
NTSTATUS
heap_free_block
(
struct
heap
*
heap
,
ULONG
flags
,
struct
block
*
block
)
{
struct
entry
*
entry
;
SIZE_T
block_size
;
SUBHEAP
*
subheap
;
if
(
heap
->
pending_free
)
{
struct
block
*
tmp
=
heap
->
pending_free
[
heap
->
pending_pos
];
heap
->
pending_free
[
heap
->
pending_pos
]
=
block
;
heap
->
pending_pos
=
(
heap
->
pending_pos
+
1
)
%
MAX_FREE_PENDING
;
block_set_type
(
block
,
BLOCK_TYPE_DEAD
);
mark_block_free
(
block
+
1
,
block_get_size
(
block
)
-
sizeof
(
*
block
),
heap
->
flags
);
if
(
!
(
block
=
tmp
))
return
STATUS_SUCCESS
;
}
block_size
=
block_get_size
(
block
);
if
(
block_get_flags
(
block
)
&
BLOCK_FLAG_PREV_FREE
)
{
...
...
@@ -1579,6 +1590,8 @@ BOOLEAN WINAPI DECLSPEC_HOTPATCH RtlFreeHeap( HANDLE handle, ULONG flags, void *
status
=
STATUS_INVALID_PARAMETER
;
else
if
(
block_get_flags
(
block
)
&
BLOCK_FLAG_LARGE
)
status
=
heap_free_large
(
heap
,
heap_flags
,
block
);
else
if
(
!
(
block
=
heap_delay_free
(
heap
,
heap_flags
,
block
)))
status
=
STATUS_SUCCESS
;
else
{
heap_lock
(
heap
,
heap_flags
);
...
...
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