From 35b9f9f37b0142c4c41ec41571e06689587b0d6f Mon Sep 17 00:00:00 2001 From: Chris Kennelly Date: Wed, 19 Aug 2026 14:08:51 -0700 Subject: [PATCH] Place hot HintedTrackerList fields together. lists_ will take up several cachelines, so we may end up accessing 3 distinct cachelines, rather than putting bitmap_ and size_ together on just 1 (plus potentially list_). PiperOrigin-RevId: 967400706 --- tcmalloc/hinted_tracker_lists.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcmalloc/hinted_tracker_lists.h b/tcmalloc/hinted_tracker_lists.h index 93afd68c8..ba9e33af7 100644 --- a/tcmalloc/hinted_tracker_lists.h +++ b/tcmalloc/hinted_tracker_lists.h @@ -145,9 +145,15 @@ class HintedTrackerLists { } private: +#ifdef TCMALLOC_INTERNAL_LEGACY_LOCKING TrackerList lists_[N]; size_t size_; Bitmap nonempty_; +#else + size_t size_; + Bitmap nonempty_; + TrackerList lists_[N]; +#endif }; } // namespace tcmalloc_internal