Commit Graph

10 Commits

Author SHA1 Message Date
Kai Germaschewski d882be1ea9
fix cmake issue with referencing a non-existing function argument (#1118)
according to https://cmake.org/cmake/help/latest/command/function.html,
"Referencing to ARGV# arguments beyond ARGC have undefined behavior.",
which I hit with cmake 3.19.7.

This uses ARGC to check whether ARGV1 has been passed before referencing
it.
2021-04-26 09:15:07 +01:00
Eric 207b9c7aec
Improve State packing: put important members on first cache line. (#527)
* Improve State packing: put important members on first cache line.

This patch does a few different things to ensure commonly accessed
data is on the first cache line of the `State` object.

First, it moves the `error_occurred_` member to reside after
the `started_` and `finished_` bools, since there was internal
padding there that was unused.

Second, it moves `batch_leftover_` and `max_iterations` further up
in the struct declaration. These variables are used in the calculation
of `iterations()` which users might call within the loop. Therefore
it's more important they exist on the first cache line.

Finally, this patch turns the bool members into bitfields. Although
this shouldn't have much of an effect currently, because padding is
still needed between the last bool and the first size_t, it should
help in future changes that require more "bool like" members.

* Remove bitfield change for now

* Move bools (and their padding) to end of "first cache line" vars.

I think it makes the most sense to move the padding required
following the group of bools to the end of the variables we want
on the first cache line.

This also means that the `total_iterations_` variable, which is the
most accessed, has the same address as the State object.

* Fix static assertion after moving bools
2018-02-14 13:44:41 -07:00
Roman Lebedev 6e06648133 Attempting to resolve a submoduling issues... (#439) 2017-08-28 16:10:19 -07:00
Eric 0dbcdf56a0 Add BENCHMARK_BUILD_32_BITS option and add builders to test it (#360)
* Add BENCHMARK_BUILD_32_BITS option and add builders to test it

* Attempt to fix travis configuration

* Make add_required_cxx_compiler_flag cause an error when the flag isn't supported

* add gcc-multilib dependancy on travis

* attempt to fix travis.yml parsing error

* Require g++-multilib instead of gcc-multilib

* Add 32 bit release configurations

* Attempt to fix libc++ travis build w/ 32 bits

* Work around CMake configuration failure on Travis
2017-03-28 00:43:42 -07:00
ktnyt d1daeee4e9 Pass flag string to `check_cxx_compiler_flag` (#298) 2016-10-05 09:19:14 -07:00
Matt Clarkson fc883f6742 Improve the CMake C++ flag checker
This checks the flag on the compiler AND linker which allows it to work
with flags such as -flto and -fsanitize=address
2015-05-01 11:09:56 +01:00
Dominic Hamon f98c5760fe Fix #54 by correcting reference to CXX flags for variants. 2014-10-11 15:13:00 -07:00
Matt Clarkson 9593e64076 Fixed the CMake add_cxx_compiler_flag function 2014-08-22 14:56:12 +01:00
Matt Clarkson edfa60a1d1 Resolve regular expression engines 2014-08-22 14:55:46 +01:00
Matt Clarkson 6b1a6958c4 CMake function for adding compiler flags 2014-08-04 10:01:44 +01:00