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
a540b4b2
Commit
a540b4b2
authored
Nov 25, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Dec 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Clear BLOCK_FLAG_PREV_FREE flag out of shrink_used_block.
parent
99388f74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
heap.c
dlls/ntdll/heap.c
+7
-4
No files found.
dlls/ntdll/heap.c
View file @
a540b4b2
...
...
@@ -824,10 +824,8 @@ static inline void shrink_used_block( struct heap *heap, ULONG flags, struct blo
}
else
{
struct
block
*
next
;
block_set_size
(
block
,
old_block_size
);
block
->
tail_size
=
old_block_size
-
sizeof
(
*
block
)
-
size
;
if
((
next
=
next_block
(
subheap
,
block
)))
block_set_flags
(
next
,
BLOCK_FLAG_PREV_FREE
,
0
);
}
}
...
...
@@ -1501,14 +1499,16 @@ static SIZE_T heap_get_block_size( const struct heap *heap, ULONG flags, SIZE_T
static
NTSTATUS
heap_allocate_block
(
struct
heap
*
heap
,
ULONG
flags
,
SIZE_T
block_size
,
SIZE_T
size
,
void
**
ret
)
{
struct
block
*
block
,
*
next
;
SIZE_T
old_block_size
;
struct
block
*
block
;
SUBHEAP
*
subheap
;
/* Locate a suitable free block */
if
(
!
(
block
=
find_free_block
(
heap
,
flags
,
block_size
)))
return
STATUS_NO_MEMORY
;
/* read the free block size, changing block type or flags may alter it */
old_block_size
=
block_get_size
(
block
);
subheap
=
block_get_subheap
(
heap
,
block
);
block_set_type
(
block
,
BLOCK_TYPE_USED
);
block_set_flags
(
block
,
~
0
,
BLOCK_USER_FLAGS
(
flags
)
);
...
...
@@ -1516,6 +1516,8 @@ static NTSTATUS heap_allocate_block( struct heap *heap, ULONG flags, SIZE_T bloc
initialize_block
(
block
,
0
,
size
,
flags
);
mark_block_tail
(
block
,
flags
);
if
((
next
=
next_block
(
subheap
,
block
)))
block_set_flags
(
next
,
BLOCK_FLAG_PREV_FREE
,
0
);
*
ret
=
block
+
1
;
return
STATUS_SUCCESS
;
}
...
...
@@ -1643,10 +1645,11 @@ static NTSTATUS heap_resize_block( struct heap *heap, ULONG flags, struct block
valgrind_notify_resize
(
block
+
1
,
*
old_size
,
size
);
block_set_flags
(
block
,
BLOCK_FLAG_USER_MASK
&
~
BLOCK_FLAG_USER_INFO
,
BLOCK_USER_FLAGS
(
flags
)
);
shrink_used_block
(
heap
,
flags
,
block
,
old_block_size
,
block_size
,
size
);
initialize_block
(
block
,
*
old_size
,
size
,
flags
);
mark_block_tail
(
block
,
flags
);
if
((
next
=
next_block
(
subheap
,
block
)))
block_set_flags
(
next
,
BLOCK_FLAG_PREV_FREE
,
0
);
heap_unlock
(
heap
,
flags
);
*
ret
=
block
+
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