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
b20f4666
Commit
b20f4666
authored
May 03, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Rename local variables in heap_allocate.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a3acd635
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
heap.c
dlls/ntdll/heap.c
+16
-17
No files found.
dlls/ntdll/heap.c
View file @
b20f4666
...
...
@@ -1536,17 +1536,16 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
static
NTSTATUS
heap_allocate
(
HEAP
*
heap
,
ULONG
flags
,
SIZE_T
size
,
void
**
ret
)
{
ARENA_FREE
*
pArena
;
ARENA_INUSE
*
pInUse
;
struct
block
*
block
;
struct
entry
*
entry
;
SIZE_T
data_size
;
SUBHEAP
*
subheap
;
SIZE_T
rounded_size
;
rounded_size
=
ROUND_SIZE
(
size
)
+
HEAP_TAIL_EXTRA_SIZE
(
flags
);
if
(
rounded_size
<
size
)
return
STATUS_NO_MEMORY
;
/* overflow */
if
(
rounded_size
<
HEAP_MIN_DATA_SIZE
)
rounded_size
=
HEAP_MIN_DATA_SIZE
;
data_size
=
ROUND_SIZE
(
size
)
+
HEAP_TAIL_EXTRA_SIZE
(
flags
);
if
(
data_size
<
size
)
return
STATUS_NO_MEMORY
;
/* overflow */
if
(
data_size
<
HEAP_MIN_DATA_SIZE
)
data_size
=
HEAP_MIN_DATA_SIZE
;
if
(
rounded
_size
>=
HEAP_MIN_LARGE_BLOCK_SIZE
)
if
(
data
_size
>=
HEAP_MIN_LARGE_BLOCK_SIZE
)
{
if
(
!
(
*
ret
=
allocate_large_block
(
heap
,
flags
,
size
)))
return
STATUS_NO_MEMORY
;
return
STATUS_SUCCESS
;
...
...
@@ -1554,29 +1553,29 @@ static NTSTATUS heap_allocate( HEAP *heap, ULONG flags, SIZE_T size, void **ret
/* Locate a suitable free block */
if
(
!
(
pArena
=
HEAP_FindFreeBlock
(
heap
,
rounded
_size
,
&
subheap
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
entry
=
HEAP_FindFreeBlock
(
heap
,
data
_size
,
&
subheap
)))
return
STATUS_NO_MEMORY
;
/* Remove the arena from the free list */
list_remove
(
&
pArena
->
entry
);
list_remove
(
&
entry
->
entry
);
/* Build the in-use arena */
pInUse
=
(
ARENA_INUSE
*
)
pArena
;
block
=
(
struct
block
*
)
entry
;
/* in-use arena is smaller than free arena,
* so we have to add the difference to the size */
pInUse
->
size
=
(
pInUse
->
size
&
~
ARENA_FLAG_FREE
)
+
sizeof
(
ARENA_FREE
)
-
sizeof
(
ARENA_INUSE
);
pInUse
->
magic
=
ARENA_INUSE_MAGIC
;
block
->
size
=
(
block
->
size
&
~
ARENA_FLAG_FREE
)
+
sizeof
(
*
entry
)
-
sizeof
(
*
block
);
block
->
magic
=
ARENA_INUSE_MAGIC
;
/* Shrink the block */
shrink_used_block
(
subheap
,
pInUse
,
rounded
_size
,
size
);
shrink_used_block
(
subheap
,
block
,
data
_size
,
size
);
notify_alloc
(
pInUse
+
1
,
size
,
flags
&
HEAP_ZERO_MEMORY
);
initialize_block
(
pInUse
+
1
,
size
,
pInUse
->
unused_bytes
,
flags
);
notify_alloc
(
block
+
1
,
size
,
flags
&
HEAP_ZERO_MEMORY
);
initialize_block
(
block
+
1
,
size
,
block
->
unused_bytes
,
flags
);
*
ret
=
pInUse
+
1
;
*
ret
=
block
+
1
;
return
STATUS_SUCCESS
;
}
...
...
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