@@ -379,7 +379,7 @@ enum BigO { oNone, o1, oN, oNSquared, oNCubed, oLogN, oNLogN, oAuto, oLambda };
379379
380380// BigOFunc is passed to a benchmark in order to specify the asymptotic
381381// computational complexity for the benchmark.
382- typedef double (BigOFunc)(int );
382+ typedef double (BigOFunc)(int64_t );
383383
384384// StatisticsFunc is passed to a benchmark in order to compute some descriptive
385385// statistics over all the measurements of some type
@@ -516,10 +516,10 @@ class State {
516516 // and complexity_n will
517517 // represent the length of N.
518518 BENCHMARK_ALWAYS_INLINE
519- void SetComplexityN (int complexity_n) { complexity_n_ = complexity_n; }
519+ void SetComplexityN (int64_t complexity_n) { complexity_n_ = complexity_n; }
520520
521521 BENCHMARK_ALWAYS_INLINE
522- int complexity_length_n () { return complexity_n_; }
522+ int64_t complexity_length_n () { return complexity_n_; }
523523
524524 // If this routine is called with items > 0, then an items/s
525525 // label is printed on the benchmark report line for the currently
@@ -553,16 +553,16 @@ class State {
553553
554554 // Range arguments for this run. CHECKs if the argument has been set.
555555 BENCHMARK_ALWAYS_INLINE
556- int range (std::size_t pos = 0 ) const {
556+ int64_t range (std::size_t pos = 0 ) const {
557557 assert (range_.size () > pos);
558558 return range_[pos];
559559 }
560560
561561 BENCHMARK_DEPRECATED_MSG (" use 'range(0)' instead" )
562- int range_x () const { return range (0 ); }
562+ int64_t range_x () const { return range (0 ); }
563563
564564 BENCHMARK_DEPRECATED_MSG (" use 'range(1)' instead" )
565- int range_y () const { return range (1 ); }
565+ int64_t range_y () const { return range (1 ); }
566566
567567 BENCHMARK_ALWAYS_INLINE
568568 size_t iterations () const { return (max_iterations - total_iterations_) + 1 ; }
@@ -572,12 +572,12 @@ class State {
572572 bool finished_;
573573 size_t total_iterations_;
574574
575- std::vector<int > range_;
575+ std::vector<int64_t > range_;
576576
577577 size_t bytes_processed_;
578578 size_t items_processed_;
579579
580- int complexity_n_;
580+ int64_t complexity_n_;
581581
582582 bool error_occurred_;
583583
@@ -591,7 +591,7 @@ class State {
591591 const size_t max_iterations;
592592
593593 // TODO(EricWF) make me private
594- State (size_t max_iters, const std::vector<int >& ranges, int thread_i,
594+ State (size_t max_iters, const std::vector<int64_t >& ranges, int thread_i,
595595 int n_threads, internal::ThreadTimer* timer,
596596 internal::ThreadManager* manager);
597597
@@ -670,31 +670,31 @@ class Benchmark {
670670 // Run this benchmark once with "x" as the extra argument passed
671671 // to the function.
672672 // REQUIRES: The function passed to the constructor must accept an arg1.
673- Benchmark* Arg (int x);
673+ Benchmark* Arg (int64_t x);
674674
675675 // Run this benchmark with the given time unit for the generated output report
676676 Benchmark* Unit (TimeUnit unit);
677677
678678 // Run this benchmark once for a number of values picked from the
679679 // range [start..limit]. (start and limit are always picked.)
680680 // REQUIRES: The function passed to the constructor must accept an arg1.
681- Benchmark* Range (int start, int limit);
681+ Benchmark* Range (int64_t start, int64_t limit);
682682
683683 // Run this benchmark once for all values in the range [start..limit] with
684684 // specific step
685685 // REQUIRES: The function passed to the constructor must accept an arg1.
686- Benchmark* DenseRange (int start, int limit, int step = 1 );
686+ Benchmark* DenseRange (int64_t start, int64_t limit, int64_t step = 1 );
687687
688688 // Run this benchmark once with "args" as the extra arguments passed
689689 // to the function.
690690 // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
691- Benchmark* Args (const std::vector<int >& args);
691+ Benchmark* Args (const std::vector<int64_t >& args);
692692
693693 // Equivalent to Args({x, y})
694694 // NOTE: This is a legacy C++03 interface provided for compatibility only.
695695 // New code should use 'Args'.
696- Benchmark* ArgPair (int x, int y) {
697- std::vector<int > args;
696+ Benchmark* ArgPair (int64_t x, int64_t y) {
697+ std::vector<int64_t > args;
698698 args.push_back (x);
699699 args.push_back (y);
700700 return Args (args);
@@ -703,7 +703,7 @@ class Benchmark {
703703 // Run this benchmark once for a number of values picked from the
704704 // ranges [start..limit]. (starts and limits are always picked.)
705705 // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
706- Benchmark* Ranges (const std::vector<std::pair<int , int > >& ranges);
706+ Benchmark* Ranges (const std::vector<std::pair<int64_t , int64_t > >& ranges);
707707
708708 // Equivalent to ArgNames({name})
709709 Benchmark* ArgName (const std::string& name);
@@ -715,8 +715,8 @@ class Benchmark {
715715 // Equivalent to Ranges({{lo1, hi1}, {lo2, hi2}}).
716716 // NOTE: This is a legacy C++03 interface provided for compatibility only.
717717 // New code should use 'Ranges'.
718- Benchmark* RangePair (int lo1, int hi1, int lo2, int hi2) {
719- std::vector<std::pair<int , int > > ranges;
718+ Benchmark* RangePair (int64_t lo1, int64_t hi1, int64_t lo2, int64_t hi2) {
719+ std::vector<std::pair<int64_t , int64_t > > ranges;
720720 ranges.push_back (std::make_pair (lo1, hi1));
721721 ranges.push_back (std::make_pair (lo2, hi2));
722722 return Ranges (ranges);
@@ -729,7 +729,7 @@ class Benchmark {
729729
730730 // Set the range multiplier for non-dense range. If not called, the range
731731 // multiplier kRangeMultiplier will be used.
732- Benchmark* RangeMultiplier (int multiplier);
732+ Benchmark* RangeMultiplier (int64_t multiplier);
733733
734734 // Set the minimum amount of time to use when running this benchmark. This
735735 // option overrides the `benchmark_min_time` flag.
@@ -823,17 +823,18 @@ class Benchmark {
823823
824824 int ArgsCnt () const ;
825825
826- static void AddRange (std::vector<int >* dst, int lo, int hi, int mult);
826+ template <typename Z>
827+ static void AddRange (std::vector<Z>* dst, Z lo, Z hi, Z mult);
827828
828829 private:
829830 friend class BenchmarkFamilies ;
830831
831832 std::string name_;
832833 ReportMode report_mode_;
833834 std::vector<std::string> arg_names_; // Args for all benchmark runs
834- std::vector<std::vector<int > > args_; // Args for all benchmark runs
835+ std::vector<std::vector<int64_t > > args_; // Args for all benchmark runs
835836 TimeUnit time_unit_;
836- int range_multiplier_;
837+ int64_t range_multiplier_;
837838 double min_time_;
838839 size_t iterations_;
839840 int repetitions_;
@@ -1239,7 +1240,7 @@ class BenchmarkReporter {
12391240 // Keep track of arguments to compute asymptotic complexity
12401241 BigO complexity;
12411242 BigOFunc* complexity_lambda;
1242- int complexity_n;
1243+ int64_t complexity_n;
12431244
12441245 // what statistics to compute from the measurements
12451246 const std::vector<Statistics>* statistics;
0 commit comments