Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
a8b36933
Unverified
Commit
a8b36933
authored
Nov 23, 2019
by
Roman Lebedev
Committed by
GitHub
Nov 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #905 from LebedevRI/misc-cleanup
Fix some issues seen in some static analysis reports
parents
c50ac68c
51d991f1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
4 deletions
+9
-4
mingw.py
mingw.py
+1
-1
benchmark.cc
src/benchmark.cc
+1
-1
benchmark_runner.cc
src/benchmark_runner.cc
+1
-1
counter.h
src/counter.h
+5
-0
json_reporter.cc
src/json_reporter.cc
+1
-1
No files found.
mingw.py
View file @
a8b36933
...
@@ -204,7 +204,7 @@ def root(location = None, arch = None, version = None, threading = None,
...
@@ -204,7 +204,7 @@ def root(location = None, arch = None, version = None, threading = None,
exceptions
=
'sjlj'
exceptions
=
'sjlj'
else
:
else
:
exceptions
=
keys
[
0
]
exceptions
=
keys
[
0
]
if
revision
==
None
:
if
revision
is
None
:
revision
=
max
(
versions
[
version
][
arch
][
threading
][
exceptions
]
.
keys
())
revision
=
max
(
versions
[
version
][
arch
][
threading
][
exceptions
]
.
keys
())
if
not
location
:
if
not
location
:
location
=
os
.
path
.
join
(
tempfile
.
gettempdir
(),
'mingw-builds'
)
location
=
os
.
path
.
join
(
tempfile
.
gettempdir
(),
'mingw-builds'
)
...
...
src/benchmark.cc
View file @
a8b36933
...
@@ -435,7 +435,7 @@ void ParseCommandLineFlags(int* argc, char** argv) {
...
@@ -435,7 +435,7 @@ void ParseCommandLineFlags(int* argc, char** argv) {
using
namespace
benchmark
;
using
namespace
benchmark
;
BenchmarkReporter
::
Context
::
executable_name
=
BenchmarkReporter
::
Context
::
executable_name
=
(
argc
&&
*
argc
>
0
)
?
argv
[
0
]
:
"unknown"
;
(
argc
&&
*
argc
>
0
)
?
argv
[
0
]
:
"unknown"
;
for
(
int
i
=
1
;
i
<
*
argc
;
++
i
)
{
for
(
int
i
=
1
;
argc
&&
i
<
*
argc
;
++
i
)
{
if
(
ParseBoolFlag
(
argv
[
i
],
"benchmark_list_tests"
,
if
(
ParseBoolFlag
(
argv
[
i
],
"benchmark_list_tests"
,
&
FLAGS_benchmark_list_tests
)
||
&
FLAGS_benchmark_list_tests
)
||
ParseStringFlag
(
argv
[
i
],
"benchmark_filter"
,
&
FLAGS_benchmark_filter
)
||
ParseStringFlag
(
argv
[
i
],
"benchmark_filter"
,
&
FLAGS_benchmark_filter
)
||
...
...
src/benchmark_runner.cc
View file @
a8b36933
...
@@ -264,7 +264,7 @@ class BenchmarkRunner {
...
@@ -264,7 +264,7 @@ class BenchmarkRunner {
// So what seems to be the sufficiently-large iteration count? Round up.
// So what seems to be the sufficiently-large iteration count? Round up.
const
IterationCount
max_next_iters
=
const
IterationCount
max_next_iters
=
0.5
+
std
::
max
(
multiplier
*
i
.
iters
,
i
.
iters
+
1.0
);
std
::
lround
(
std
::
max
(
multiplier
*
i
.
iters
,
i
.
iters
+
1.0
)
);
// But we do have *some* sanity limits though..
// But we do have *some* sanity limits though..
const
IterationCount
next_iters
=
std
::
min
(
max_next_iters
,
kMaxIterations
);
const
IterationCount
next_iters
=
std
::
min
(
max_next_iters
,
kMaxIterations
);
...
...
src/counter.h
View file @
a8b36933
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
#ifndef COUNTER_H_
#define COUNTER_H_
#include "benchmark/benchmark.h"
#include "benchmark/benchmark.h"
namespace
benchmark
{
namespace
benchmark
{
...
@@ -25,3 +28,5 @@ bool SameNames(UserCounters const& l, UserCounters const& r);
...
@@ -25,3 +28,5 @@ bool SameNames(UserCounters const& l, UserCounters const& r);
}
// end namespace internal
}
// end namespace internal
}
// end namespace benchmark
}
// end namespace benchmark
#endif // COUNTER_H_
src/json_reporter.cc
View file @
a8b36933
...
@@ -92,7 +92,7 @@ std::string FormatKV(std::string const& key, double value) {
...
@@ -92,7 +92,7 @@ std::string FormatKV(std::string const& key, double value) {
return
ss
.
str
();
return
ss
.
str
();
}
}
int64_t
RoundDouble
(
double
v
)
{
return
st
atic_cast
<
int64_t
>
(
v
+
0.5
);
}
int64_t
RoundDouble
(
double
v
)
{
return
st
d
::
lround
(
v
);
}
}
// end namespace
}
// end namespace
...
...
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