Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2Classic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PAS
SRB2Classic
Commits
4fdb2f6b
Commit
4fdb2f6b
authored
6 months ago
by
Hanicef
Browse files
Options
Downloads
Patches
Plain Diff
Fix segfault when switching perfstats screen before sampling is done
parent
28d5b79f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/m_perfstats.c
+6
-6
6 additions, 6 deletions
src/m_perfstats.c
with
6 additions
and
6 deletions
src/m_perfstats.c
+
6
−
6
View file @
4fdb2f6b
...
@@ -453,7 +453,7 @@ static int PS_DrawPerfRows(int x, int y, int color, perfstatrow_t *rows)
...
@@ -453,7 +453,7 @@ static int PS_DrawPerfRows(int x, int y, int color, perfstatrow_t *rows)
return
draw_y
;
return
draw_y
;
}
}
static
void
PS_UpdateMetricHistory
(
ps_metric_t
*
metric
,
boolean
time_metric
,
boolean
frame_metric
,
boolean
set_user
)
static
void
PS_UpdateMetricHistory
(
ps_metric_t
*
metric
,
boolean
time_metric
,
boolean
frame_metric
)
{
{
int
index
=
frame_metric
?
ps_frame_index
:
ps_tick_index
;
int
index
=
frame_metric
?
ps_frame_index
:
ps_tick_index
;
...
@@ -461,7 +461,7 @@ static void PS_UpdateMetricHistory(ps_metric_t *metric, boolean time_metric, boo
...
@@ -461,7 +461,7 @@ static void PS_UpdateMetricHistory(ps_metric_t *metric, boolean time_metric, boo
{
{
// allocate history table
// allocate history table
int
value_size
=
time_metric
?
sizeof
(
precise_t
)
:
sizeof
(
INT32
);
int
value_size
=
time_metric
?
sizeof
(
precise_t
)
:
sizeof
(
INT32
);
void
**
memory_user
=
set_user
?
&
metric
->
history
:
NULL
;
void
**
memory_user
=
&
metric
->
history
;
metric
->
history
=
Z_Calloc
(
value_size
*
cv_ps_samplesize
.
value
,
PU_PERFSTATS
,
metric
->
history
=
Z_Calloc
(
value_size
*
cv_ps_samplesize
.
value
,
PU_PERFSTATS
,
memory_user
);
memory_user
);
...
@@ -491,7 +491,7 @@ static void PS_UpdateRowHistories(perfstatrow_t *rows, boolean frame_metric)
...
@@ -491,7 +491,7 @@ static void PS_UpdateRowHistories(perfstatrow_t *rows, boolean frame_metric)
for
(
row
=
rows
;
row
->
lores_label
;
row
++
)
for
(
row
=
rows
;
row
->
lores_label
;
row
++
)
{
{
if
(
PS_IsRowValid
(
row
))
if
(
PS_IsRowValid
(
row
))
PS_UpdateMetricHistory
(
row
->
metric
,
!!
(
row
->
flags
&
PS_TIME
),
frame_metric
,
true
);
PS_UpdateMetricHistory
(
row
->
metric
,
!!
(
row
->
flags
&
PS_TIME
),
frame_metric
);
}
}
}
}
...
@@ -649,17 +649,17 @@ void PS_UpdateTickStats(void)
...
@@ -649,17 +649,17 @@ void PS_UpdateTickStats(void)
if
(
cv_perfstats
.
value
==
3
)
if
(
cv_perfstats
.
value
==
3
)
{
{
for
(
i
=
0
;
i
<
thinkframe_hooks_length
;
i
++
)
for
(
i
=
0
;
i
<
thinkframe_hooks_length
;
i
++
)
PS_UpdateMetricHistory
(
&
thinkframe_hooks
[
i
].
time_taken
,
true
,
false
,
false
);
PS_UpdateMetricHistory
(
&
thinkframe_hooks
[
i
].
time_taken
,
true
,
false
);
}
}
else
if
(
cv_perfstats
.
value
==
4
)
else
if
(
cv_perfstats
.
value
==
4
)
{
{
for
(
i
=
0
;
i
<
prethinkframe_hooks_length
;
i
++
)
for
(
i
=
0
;
i
<
prethinkframe_hooks_length
;
i
++
)
PS_UpdateMetricHistory
(
&
prethinkframe_hooks
[
i
].
time_taken
,
true
,
false
,
false
);
PS_UpdateMetricHistory
(
&
prethinkframe_hooks
[
i
].
time_taken
,
true
,
false
);
}
}
else
if
(
cv_perfstats
.
value
==
5
)
else
if
(
cv_perfstats
.
value
==
5
)
{
{
for
(
i
=
0
;
i
<
postthinkframe_hooks_length
;
i
++
)
for
(
i
=
0
;
i
<
postthinkframe_hooks_length
;
i
++
)
PS_UpdateMetricHistory
(
&
postthinkframe_hooks
[
i
].
time_taken
,
true
,
false
,
false
);
PS_UpdateMetricHistory
(
&
postthinkframe_hooks
[
i
].
time_taken
,
true
,
false
);
}
}
}
}
if
(
cv_perfstats
.
value
)
if
(
cv_perfstats
.
value
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment