[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.3.3] Explain a bit more about branch prediction in the unit-test case



commit 5e582c7ffafd9075373131e5e55b69507f54206e
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Mon Oct 15 10:16:34 2018 -0400

    Explain a bit more about branch prediction in the unit-test case
---
 src/common/util_bug.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/common/util_bug.h b/src/common/util_bug.h
index 22ec37d38..f3e5b7c96 100644
--- a/src/common/util_bug.h
+++ b/src/common/util_bug.h
@@ -38,6 +38,10 @@
  * and then passed right to a conditional.  If you do anything else to the
  * expression here, or introduce any more parentheses, the compiler won't
  * help you.
+ *
+ * We only do this for the unit-test build case because it interferes with
+ * the likely-branch labeling.  Note below that in the other case, we define
+ * these macros to just be synonyms for PREDICT_(UN)LIKELY.
  */
 #define ASSERT_PREDICT_UNLIKELY_(e)             \
   ({                                            \



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits