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
2cc6f00a
Commit
2cc6f00a
authored
May 27, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Rename freeList variables to free_list.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
7964d641
Hide 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 @
2cc6f00a
...
...
@@ -150,11 +150,11 @@ C_ASSERT( HEAP_MAX_SMALL_FREE_LIST % ALIGNMENT == 0 );
#define HEAP_NB_SMALL_FREE_LISTS (((HEAP_MAX_SMALL_FREE_LIST - HEAP_MIN_BLOCK_SIZE) / ALIGNMENT) + 1)
/* Max size of the blocks on the free lists above HEAP_MAX_SMALL_FREE_LIST */
static
const
SIZE_T
HEAP_freeListS
izes
[]
=
static
const
SIZE_T
free_list_s
izes
[]
=
{
0x200
,
0x400
,
0x1000
,
~
(
SIZE_T
)
0
};
#define HEAP_NB_FREE_LISTS (ARRAY_SIZE(
HEAP_freeListSizes
) + HEAP_NB_SMALL_FREE_LISTS)
#define HEAP_NB_FREE_LISTS (ARRAY_SIZE(
free_list_sizes
) + HEAP_NB_SMALL_FREE_LISTS)
typedef
union
{
...
...
@@ -200,7 +200,7 @@ typedef struct tagHEAP
DWORD
pending_pos
;
/* Position in pending free requests ring */
ARENA_INUSE
**
pending_free
;
/* Ring buffer for pending free requests */
RTL_CRITICAL_SECTION
cs
;
FREE_LIST_ENTRY
free
List
[
HEAP_NB_FREE_LISTS
];
FREE_LIST_ENTRY
free
_lists
[
HEAP_NB_FREE_LISTS
];
SUBHEAP
subheap
;
}
HEAP
;
...
...
@@ -425,16 +425,16 @@ static void notify_free_all( SUBHEAP *subheap )
/* size is the size of the whole block including the arena header */
static
inline
struct
entry
*
find_free_list
(
HEAP
*
heap
,
SIZE_T
block_size
,
BOOL
last
)
{
FREE_LIST_ENTRY
*
list
,
*
end
=
heap
->
free
List
+
ARRAY_SIZE
(
heap
->
freeList
);
FREE_LIST_ENTRY
*
list
,
*
end
=
heap
->
free
_lists
+
ARRAY_SIZE
(
heap
->
free_lists
);
unsigned
int
i
;
if
(
block_size
<=
HEAP_MAX_SMALL_FREE_LIST
)
i
=
(
block_size
-
HEAP_MIN_BLOCK_SIZE
)
/
ALIGNMENT
;
else
for
(
i
=
HEAP_NB_SMALL_FREE_LISTS
;
i
<
HEAP_NB_FREE_LISTS
-
1
;
i
++
)
if
(
block_size
<=
HEAP_freeListS
izes
[
i
-
HEAP_NB_SMALL_FREE_LISTS
])
break
;
if
(
block_size
<=
free_list_s
izes
[
i
-
HEAP_NB_SMALL_FREE_LISTS
])
break
;
list
=
heap
->
free
List
+
i
;
if
(
last
&&
++
list
==
end
)
list
=
heap
->
free
List
;
list
=
heap
->
free
_lists
+
i
;
if
(
last
&&
++
list
==
end
)
list
=
heap
->
free
_lists
;
return
&
list
->
arena
;
}
...
...
@@ -486,14 +486,14 @@ static void heap_dump( const HEAP *heap )
TRACE
(
"heap: %p
\n
"
,
heap
);
TRACE
(
" next %p
\n
"
,
LIST_ENTRY
(
heap
->
entry
.
next
,
HEAP
,
entry
)
);
TRACE
(
" free_lists: %p
\n
"
,
heap
->
free
List
);
TRACE
(
" free_lists: %p
\n
"
,
heap
->
free
_lists
);
for
(
i
=
0
;
i
<
HEAP_NB_FREE_LISTS
;
i
++
)
{
if
(
i
<
HEAP_NB_SMALL_FREE_LISTS
)
size
=
HEAP_MIN_BLOCK_SIZE
+
i
*
ALIGNMENT
;
else
size
=
HEAP_freeListS
izes
[
i
-
HEAP_NB_SMALL_FREE_LISTS
];
TRACE
(
" %p: size %8Ix, prev %p, next %p
\n
"
,
heap
->
free
List
+
i
,
size
,
LIST_ENTRY
(
heap
->
free
List
[
i
].
arena
.
entry
.
prev
,
struct
entry
,
entry
),
LIST_ENTRY
(
heap
->
free
List
[
i
].
arena
.
entry
.
next
,
struct
entry
,
entry
)
);
else
size
=
free_list_s
izes
[
i
-
HEAP_NB_SMALL_FREE_LISTS
];
TRACE
(
" %p: size %8Ix, prev %p, next %p
\n
"
,
heap
->
free
_lists
+
i
,
size
,
LIST_ENTRY
(
heap
->
free
_lists
[
i
].
arena
.
entry
.
prev
,
struct
entry
,
entry
),
LIST_ENTRY
(
heap
->
free
_lists
[
i
].
arena
.
entry
.
next
,
struct
entry
,
entry
)
);
}
TRACE
(
" subheaps: %p
\n
"
,
&
heap
->
subheap_list
);
...
...
@@ -968,8 +968,8 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags,
/* Build the free lists */
list_init
(
&
heap
->
free
List
[
0
].
arena
.
entry
);
for
(
i
=
0
,
pEntry
=
heap
->
free
List
;
i
<
HEAP_NB_FREE_LISTS
;
i
++
,
pEntry
++
)
list_init
(
&
heap
->
free
_lists
[
0
].
arena
.
entry
);
for
(
i
=
0
,
pEntry
=
heap
->
free
_lists
;
i
<
HEAP_NB_FREE_LISTS
;
i
++
,
pEntry
++
)
{
block_set_size
(
&
pEntry
->
arena
.
block
,
BLOCK_FLAG_FREE_LINK
,
0
);
block_set_type
(
&
pEntry
->
arena
.
block
,
ARENA_FREE_MAGIC
);
...
...
@@ -1025,7 +1025,7 @@ static struct block *find_free_block( HEAP *heap, SIZE_T block_size, SUBHEAP **s
/* Find a suitable free list, and in it find a block large enough */
while
((
ptr
=
list_next
(
&
heap
->
free
List
[
0
].
arena
.
entry
,
ptr
)))
while
((
ptr
=
list_next
(
&
heap
->
free
_lists
[
0
].
arena
.
entry
,
ptr
)))
{
entry
=
LIST_ENTRY
(
ptr
,
struct
entry
,
entry
);
block
=
(
struct
block
*
)
entry
;
...
...
@@ -1078,8 +1078,7 @@ static BOOL is_valid_free_block( const HEAP *heap, const struct block *block )
unsigned
int
i
;
if
((
subheap
=
find_subheap
(
heap
,
block
,
FALSE
)))
return
TRUE
;
if
(
block_get_flags
(
block
)
!=
BLOCK_FLAG_FREE_LINK
)
return
FALSE
;
for
(
i
=
0
;
i
<
HEAP_NB_FREE_LISTS
;
i
++
)
if
(
block
==
&
heap
->
freeList
[
i
].
arena
.
block
)
return
TRUE
;
for
(
i
=
0
;
i
<
HEAP_NB_FREE_LISTS
;
i
++
)
if
(
block
==
&
heap
->
free_lists
[
i
].
arena
.
block
)
return
TRUE
;
return
FALSE
;
}
...
...
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