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
1025ed38
Commit
1025ed38
authored
Apr 21, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Apr 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Increase size of PID table and do not reuse recently freed ptids.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e4d94e48
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
process.c
server/process.c
+5
-3
No files found.
server/process.c
View file @
1025ed38
...
@@ -338,6 +338,7 @@ static unsigned int used_ptid_entries; /* number of entries in use */
...
@@ -338,6 +338,7 @@ static unsigned int used_ptid_entries; /* number of entries in use */
static
unsigned
int
alloc_ptid_entries
;
/* number of allocated entries */
static
unsigned
int
alloc_ptid_entries
;
/* number of allocated entries */
static
unsigned
int
next_free_ptid
;
/* next free entry */
static
unsigned
int
next_free_ptid
;
/* next free entry */
static
unsigned
int
last_free_ptid
;
/* last free entry */
static
unsigned
int
last_free_ptid
;
/* last free entry */
static
unsigned
int
num_free_ptids
;
/* number of free ptids */
static
void
kill_all_processes
(
void
);
static
void
kill_all_processes
(
void
);
...
@@ -354,16 +355,17 @@ unsigned int alloc_ptid( void *ptr )
...
@@ -354,16 +355,17 @@ unsigned int alloc_ptid( void *ptr )
id
=
used_ptid_entries
+
PTID_OFFSET
;
id
=
used_ptid_entries
+
PTID_OFFSET
;
entry
=
&
ptid_entries
[
used_ptid_entries
++
];
entry
=
&
ptid_entries
[
used_ptid_entries
++
];
}
}
else
if
(
next_free_ptid
)
else
if
(
next_free_ptid
&&
num_free_ptids
>=
256
)
{
{
id
=
next_free_ptid
;
id
=
next_free_ptid
;
entry
=
&
ptid_entries
[
id
-
PTID_OFFSET
];
entry
=
&
ptid_entries
[
id
-
PTID_OFFSET
];
if
(
!
(
next_free_ptid
=
entry
->
next
))
last_free_ptid
=
0
;
if
(
!
(
next_free_ptid
=
entry
->
next
))
last_free_ptid
=
0
;
num_free_ptids
--
;
}
}
else
/* need to grow the array */
else
/* need to grow the array */
{
{
unsigned
int
count
=
alloc_ptid_entries
+
(
alloc_ptid_entries
/
2
);
unsigned
int
count
=
alloc_ptid_entries
+
(
alloc_ptid_entries
/
2
);
if
(
!
count
)
count
=
64
;
if
(
!
count
)
count
=
512
;
if
(
!
(
entry
=
realloc
(
ptid_entries
,
count
*
sizeof
(
*
entry
)
)))
if
(
!
(
entry
=
realloc
(
ptid_entries
,
count
*
sizeof
(
*
entry
)
)))
{
{
set_error
(
STATUS_NO_MEMORY
);
set_error
(
STATUS_NO_MEMORY
);
...
@@ -390,8 +392,8 @@ void free_ptid( unsigned int id )
...
@@ -390,8 +392,8 @@ void free_ptid( unsigned int id )
/* append to end of free list so that we don't reuse it too early */
/* append to end of free list so that we don't reuse it too early */
if
(
last_free_ptid
)
ptid_entries
[
last_free_ptid
-
PTID_OFFSET
].
next
=
id
;
if
(
last_free_ptid
)
ptid_entries
[
last_free_ptid
-
PTID_OFFSET
].
next
=
id
;
else
next_free_ptid
=
id
;
else
next_free_ptid
=
id
;
last_free_ptid
=
id
;
last_free_ptid
=
id
;
num_free_ptids
++
;
}
}
/* retrieve the pointer corresponding to a process or thread id */
/* retrieve the pointer corresponding to a process or thread id */
...
...
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