Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tcmalloc/sizemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ class SizeMap {
return true;
} else if (s <= kMaxSize) {
idx = ((s + 127 + 120 * 128) >> 7);

// TODO(b/64294063): Add a dummy statement to keep the tail of the fast
// and the slow paths from being deduplicated, turning the shifts into
// a variable-width shift (shr reg, cl on x86); these are especially
// bad on Skylake, where they require three µops that often run in
// three successive cycles. (If we are compiling with BMI2,
// the compiler will use the much cheaper SHRX instruction, and
// the problem is more modest.)
//
// See SLOW_PATH_BARRIER() in tcmalloc.cc for more information
// about this technique.
asm volatile("");

return true;
}
return false;
Expand Down
Loading