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
f2efdfbd
Commit
f2efdfbd
authored
Oct 04, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add logging for free ranges.
parent
fb6a6374
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
6 deletions
+25
-6
virtual.c
dlls/ntdll/unix/virtual.c
+25
-6
No files found.
dlls/ntdll/unix/virtual.c
View file @
f2efdfbd
...
...
@@ -77,6 +77,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
virtual
);
WINE_DECLARE_DEBUG_CHANNEL
(
module
);
WINE_DECLARE_DEBUG_CHANNEL
(
virtual_ranges
);
struct
preload_info
{
...
...
@@ -189,6 +190,7 @@ static struct list teb_list = LIST_INIT( teb_list );
#define ROUND_SIZE(addr,size) (((SIZE_T)(size) + ((UINT_PTR)(addr) & page_mask) + page_mask) & ~page_mask)
#define VIRTUAL_DEBUG_DUMP_VIEW(view) do { if (TRACE_ON(virtual)) dump_view(view); } while (0)
#define VIRTUAL_DEBUG_DUMP_RANGES() do { if (TRACE_ON(virtual_ranges)) dump_free_ranges(); } while (0)
#ifndef MAP_NORESERVE
#define MAP_NORESERVE 0
...
...
@@ -711,6 +713,12 @@ static struct range_entry *free_ranges_lower_bound( void *addr )
return
begin
;
}
static
void
dump_free_ranges
(
void
)
{
struct
range_entry
*
r
;
for
(
r
=
free_ranges
;
r
!=
free_ranges_end
;
++
r
)
TRACE_
(
virtual_ranges
)(
"%p - %p.
\n
"
,
r
->
base
,
r
->
end
);
}
/***********************************************************************
* free_ranges_insert_view
...
...
@@ -737,10 +745,14 @@ static void free_ranges_insert_view( struct file_view *view )
if
(
range
->
end
==
view_base
&&
next
->
base
>=
view_end
)
view_end
=
view_base
;
TRACE
(
"%p - %p, aligned %p - %p.
\n
"
,
view
->
base
,
(
char
*
)
view
->
base
+
view
->
size
,
view_base
,
view_end
);
TRACE_
(
virtual_ranges
)(
"%p - %p, aligned %p - %p.
\n
"
,
view
->
base
,
(
char
*
)
view
->
base
+
view
->
size
,
view_base
,
view_end
);
if
(
view_end
<=
view_base
)
{
VIRTUAL_DEBUG_DUMP_RANGES
();
return
;
}
/* this should never happen */
if
(
range
->
base
>
view_base
||
range
->
end
<
view_end
)
...
...
@@ -768,16 +780,19 @@ static void free_ranges_insert_view( struct file_view *view )
else
range
->
base
=
view_end
;
if
(
range
->
base
<
range
->
end
)
return
;
if
(
range
->
base
<
range
->
end
)
{
VIRTUAL_DEBUG_DUMP_RANGES
();
return
;
}
/* and possibly remove it if it's now empty */
memmove
(
range
,
next
,
(
free_ranges_end
-
next
)
*
sizeof
(
struct
range_entry
)
);
free_ranges_end
-=
1
;
assert
(
free_ranges_end
-
free_ranges
>
0
);
}
VIRTUAL_DEBUG_DUMP_RANGES
();
}
/***********************************************************************
* free_ranges_remove_view
*
...
...
@@ -803,11 +818,14 @@ static void free_ranges_remove_view( struct file_view *view )
if
(
next_view_base
&&
next_view_base
<
view_end
&&
next_view_end
>
view_base
)
view_end
=
next_view_base
;
TRACE
(
"%p - %p, aligned %p - %p.
\n
"
,
view
->
base
,
(
char
*
)
view
->
base
+
view
->
size
,
view_base
,
view_end
);
TRACE_
(
virtual_ranges
)(
"%p - %p, aligned %p - %p.
\n
"
,
view
->
base
,
(
char
*
)
view
->
base
+
view
->
size
,
view_base
,
view_end
);
if
(
view_end
<=
view_base
)
{
VIRTUAL_DEBUG_DUMP_RANGES
();
return
;
}
/* free_ranges initial value is such that the view is either inside range or before another one. */
assert
(
range
!=
free_ranges_end
);
assert
(
range
->
end
>
view_base
||
next
!=
free_ranges_end
);
...
...
@@ -849,6 +867,7 @@ static void free_ranges_remove_view( struct file_view *view )
range
->
base
=
view_base
;
range
->
end
=
view_end
;
}
VIRTUAL_DEBUG_DUMP_RANGES
();
}
...
...
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