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
90f766fa
Commit
90f766fa
authored
May 01, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use next_block helper in heap_reallocate.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
39697a2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
heap.c
dlls/ntdll/heap.c
+7
-7
No files found.
dlls/ntdll/heap.c
View file @
90f766fa
...
...
@@ -1683,7 +1683,7 @@ static NTSTATUS heap_reallocate( HEAP *heap, ULONG flags, void *ptr, SIZE_T size
oldActualSize
=
(
pArena
->
size
&
ARENA_SIZE_MASK
)
-
pArena
->
unused_bytes
;
if
(
rounded_size
>
oldBlockSize
)
{
char
*
pNext
=
(
char
*
)(
pArena
+
1
)
+
oldBlockSize
;
struct
block
*
next
;
if
(
rounded_size
>=
HEAP_MIN_LARGE_BLOCK_SIZE
&&
(
flags
&
HEAP_GROWABLE
))
{
...
...
@@ -1694,14 +1694,14 @@ static NTSTATUS heap_reallocate( HEAP *heap, ULONG flags, void *ptr, SIZE_T size
HEAP_MakeInUseBlockFree
(
subheap
,
pArena
);
return
STATUS_SUCCESS
;
}
if
((
pNext
<
(
char
*
)
subheap
->
base
+
subheap
->
size
)
&&
(
*
(
DWORD
*
)
pNext
&
ARENA_FLAG_FREE
)
&&
(
oldBlockSize
+
(
*
(
DWORD
*
)
pNext
&
ARENA_SIZE_MASK
)
+
sizeof
(
ARENA_FREE
)
>=
rounded_size
))
if
((
next
=
next_block
(
subheap
,
pArena
))
&&
(
block_get_flags
(
next
)
&
ARENA_FLAG_FREE
)
&&
(
oldBlockSize
+
block_get_size
(
next
)
>=
rounded_size
))
{
/* The next block is free and large enough */
ARENA_FREE
*
pFree
=
(
ARENA_FREE
*
)
pN
ext
;
list_remove
(
&
pFree
->
entry
);
pArena
->
size
+=
(
pFree
->
size
&
ARENA_SIZE_MASK
)
+
sizeof
(
*
pFree
);
struct
entry
*
entry
=
(
struct
entry
*
)
n
ext
;
list_remove
(
&
entry
->
entry
);
pArena
->
size
+=
block_get_size
(
next
);
if
(
!
HEAP_Commit
(
subheap
,
pArena
,
rounded_size
))
return
STATUS_NO_MEMORY
;
notify_realloc
(
pArena
+
1
,
oldActualSize
,
size
);
HEAP_ShrinkBlock
(
subheap
,
pArena
,
rounded_size
);
...
...
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