Skip to content

Commit cc67386

Browse files
authored
[scudo] Add ALWAYS_INLINE to ScopedTSD ctor (#81982)
Fix for performance regression introduced by #80061 that slowed down Fuchsia's MallocFree microbenchmark by 3.5 - 8%
1 parent 2d9f350 commit cc67386

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler-rt/lib/scudo/standalone/tsd_exclusive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ template <class Allocator> struct TSDRegistryExT {
3030
using ThisT = TSDRegistryExT<Allocator>;
3131

3232
struct ScopedTSD {
33-
ScopedTSD(ThisT &TSDRegistry) {
33+
ALWAYS_INLINE ScopedTSD(ThisT &TSDRegistry) {
3434
CurrentTSD = TSDRegistry.getTSDAndLock(&UnlockRequired);
3535
DCHECK_NE(CurrentTSD, nullptr);
3636
}

compiler-rt/lib/scudo/standalone/tsd_shared.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct TSDRegistrySharedT {
2929
using ThisT = TSDRegistrySharedT<Allocator, TSDsArraySize, DefaultTSDCount>;
3030

3131
struct ScopedTSD {
32-
ScopedTSD(ThisT &TSDRegistry) {
32+
ALWAYS_INLINE ScopedTSD(ThisT &TSDRegistry) {
3333
CurrentTSD = TSDRegistry.getTSDAndLock();
3434
DCHECK_NE(CurrentTSD, nullptr);
3535
}

0 commit comments

Comments
 (0)