Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #24688
Closed (moved) (moved)
Open
Issue created Dec 20, 2017 by Nick Mathewson@nickm🤹

timing wheels should use 32-bit math on 32-bit platforms

I think this might help our 32-bit performance a bit.

Not putting this in needs_review yet, since it needs more analysis.

diff --git a/src/common/timers.c b/src/common/timers.c
index 93cde7de5fbd4b..3c806b7f4b422a 100644
--- a/src/common/timers.c
+++ b/src/common/timers.c
@@ -66,6 +66,11 @@ struct timeout_cb {
  * above TIMEOUT_MAX can also be super-inefficent. Choosing 5 here sets
  * timeout_max to 2^30 ticks, or 29 hours with our value for USEC_PER_TICK */
 #define WHEEL_NUM 5
+#if SIZEOF_VOID_P == 4
+/* On 32-bit platforms, we want to override wheel_bit, so that timeout.c will
+ * use 32-bit math. */
+#define WHEEL_BIT 5
+#endif
 #include "src/ext/timeouts/timeout.c"
 
 static struct timeouts *global_timeouts = NULL;
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking