Skip to content

Commit e8737ee

Browse files
test ci
1 parent 5fa0322 commit e8737ee

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
lines changed

core/include/codspeed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CodSpeed {
3434
struct RawWalltimeBenchmark {
3535
std::string name;
3636
std::string uri;
37-
int64_t iter_per_round;
37+
uint64_t iter_per_round;
3838
double mean_ns;
3939
double median_ns;
4040
double stdev_ns;

core/src/walltime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct BenchmarkStats {
3232
double total_time;
3333
uint64_t iqr_outlier_rounds;
3434
uint64_t stdev_outlier_rounds;
35-
int64_t iter_per_round;
35+
uint64_t iter_per_round;
3636
uint64_t warmup_iters;
3737
};
3838

core/src/workspace.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace codspeed {
99

1010
std::string safe_getenv(const char* var_name) {
1111
#ifdef _WIN32
12+
// On Windows, use _dupenv_s instead of std::getenv for thread safety
13+
// and to avoid issues with buffer ownership
1214
char* value;
1315
size_t len;
1416
errno_t err = _dupenv_s(&value, &len, var_name);

google_benchmark/include/benchmark/benchmark.h

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
185185

186186
#ifdef CODSPEED_ENABLED
187187
#include <codspeed.h>
188-
#include <measurement.hpp>
189188

190189
#include <filesystem>
191-
#endif // CODSPEED_ENABLED
190+
#include <measurement.hpp>
191+
#endif // CODSPEED_ENABLED
192192

193193
#if defined(_MSC_VER)
194194
#include <intrin.h> // for _ReadWriteBarrier
@@ -947,7 +947,7 @@ class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {
947947
public:
948948
const IterationCount max_iterations;
949949
#ifdef CODSPEED_INSTRUMENTATION
950-
codspeed::CodSpeed *codspeed_;
950+
codspeed::CodSpeed* codspeed_;
951951
#endif
952952

953953
private:
@@ -970,11 +970,11 @@ class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {
970970
internal::ThreadTimer* timer, internal::ThreadManager* manager,
971971
internal::PerfCountersMeasurement* perf_counters_measurement,
972972
ProfilerManager* profiler_manager
973-
#ifdef CODSPEED_INSTRUMENTATION
973+
#ifdef CODSPEED_INSTRUMENTATION
974974
,
975-
codspeed::CodSpeed *codspeed = NULL
976-
#endif
977-
);
975+
codspeed::CodSpeed* codspeed = NULL
976+
#endif
977+
);
978978

979979
void StartKeepRunning();
980980
// Implementation of KeepRunning() and KeepRunningBatch().
@@ -1460,26 +1460,23 @@ class Fixture : public internal::Benchmark {
14601460
BaseClass##_##Method##_Benchmark
14611461

14621462
#ifdef _MSC_VER
1463-
#define BENCHMARK_PRIVATE_DECLARE(n) \
1464-
/* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
1465-
static ::benchmark::internal::Benchmark const* const BENCHMARK_PRIVATE_NAME( \
1466-
n)
1463+
#define BENCHMARK_PRIVATE_DECLARE(n) \
1464+
/* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
1465+
static ::benchmark::internal::Benchmark const* const BENCHMARK_PRIVATE_NAME(n)
14671466
#else
1468-
#define BENCHMARK_PRIVATE_DECLARE(n) \
1469-
/* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
1470-
static ::benchmark::internal::Benchmark const* const BENCHMARK_PRIVATE_NAME( \
1471-
n) [[maybe_unused]]
1467+
#define BENCHMARK_PRIVATE_DECLARE(n) \
1468+
/* NOLINTNEXTLINE(misc-use-anonymous-namespace) */ \
1469+
static ::benchmark::internal::Benchmark const* const BENCHMARK_PRIVATE_NAME(n)
14721470
#endif
14731471

14741472
#ifdef CODSPEED_ENABLED
1475-
#define CUR_FILE \
1476-
codspeed::get_path_relative_to_workspace(__FILE__) + "::"
1473+
#define CUR_FILE codspeed::get_path_relative_to_workspace(__FILE__) + "::"
14771474
#ifdef _MSC_VER
1478-
#define NAMESPACE std::string("")
1479-
#else
1475+
// TODO: __PRETTY_FUNCTION__ is not available in MSVC and we dont support
1476+
#define __PRETTY_FUNCTION__ "unsupported"
1477+
#endif
14801478
#define NAMESPACE \
14811479
(([]() { return codspeed::extract_lambda_namespace(__PRETTY_FUNCTION__); })())
1482-
#endif
14831480
#define STATIC_NAMESPACE_STRING(name) static std::string name = NAMESPACE;
14841481

14851482
#define FILE_AND_NAMESPACE CUR_FILE + NAMESPACE
@@ -1618,12 +1615,12 @@ class Fixture : public internal::Benchmark {
16181615
#ifdef CODSPEED_ENABLED
16191616

16201617
#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
1621-
STATIC_NAMESPACE_STRING(ns_##BaseClass##_##Method); \
1618+
STATIC_NAMESPACE_STRING(ns_##BaseClass##_##Method); \
16221619
class BaseClass##_##Method##_Benchmark : public BaseClass { \
16231620
public: \
16241621
BaseClass##_##Method##_Benchmark() { \
16251622
this->SetName(CUR_FILE + ns_##BaseClass##_##Method + \
1626-
#Method "[" #BaseClass "]"); \
1623+
#Method "[" #BaseClass "]"); \
16271624
} \
16281625
\
16291626
protected: \
@@ -1669,7 +1666,7 @@ class Fixture : public internal::Benchmark {
16691666
void BenchmarkCase(::benchmark::State&) override; \
16701667
};
16711668

1672-
#else // CODSPEED_ENABLED undefined:
1669+
#else // CODSPEED_ENABLED undefined:
16731670

16741671
#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
16751672
class BaseClass##_##Method##_Benchmark : public BaseClass { \

0 commit comments

Comments
 (0)