Index: build/config/BUILD.gn |
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn |
index 60f4d1b120aadcd5f94bbf6a2708ca183ba9b06c..d72d4044f3ec3c0a4bcb72bbdde45e0c289dd634 100644 |
--- a/build/config/BUILD.gn |
+++ b/build/config/BUILD.gn |
@@ -12,10 +12,16 @@ import("//build/module_args/v8.gni") |
import("//build/toolchain/goma.gni") |
declare_args() { |
- # When set, turns off the (normally-on) iterator debugging and related stuff |
- # that is normally turned on for Debug builds. These are generally useful for |
- # catching bugs but in some cases may cause conflicts or excessive slowness. |
- disable_iterator_debugging = false |
+ # When set (the default) enables C++ iterator debugging in debug builds. |
+ # Iterator debugging is always off in release builds (technically, this flag |
+ # affects the "debug" config, which is always available but applied by |
+ # default only in debug builds). |
+ # |
+ # Iterator debugging is generally useful for catching bugs. But it can |
+ # introduce extra locking to check the state of an iterator against the state |
+ # of the current object. For iterator- and thread-heavy code, this can |
+ # significantly slow execution. |
+ enable_iterator_debugging = true |
# Set to true to not store any build metadata, e.g. ifdef out all __DATE__ |
# and __TIME__. Set to 0 to reenable the use of these macros in the code |
@@ -299,13 +305,12 @@ config("debug") { |
} |
if (is_win) { |
- if (disable_iterator_debugging) { |
- # Iterator debugging is enabled by the compiler on debug builds, and we |
- # have to tell it to turn it off. |
+ if (!enable_iterator_debugging) { |
+ # Iterator debugging is enabled by default by the compiler on debug |
+ # builds, and we have to tell it to turn it off. |
defines += [ "_HAS_ITERATOR_DEBUGGING=0" ] |
} |
- } else if (is_linux && !is_android && current_cpu == "x64" && |
- !disable_iterator_debugging) { |
+ } else if (is_linux && current_cpu == "x64" && enable_iterator_debugging) { |
# Enable libstdc++ debugging facilities to help catch problems early, see |
# http://crbug.com/65151 . |
# TODO(phajdan.jr): Should we enable this for all of POSIX? |