Skip to content

Commit ee870e5

Browse files
authored
[compiler-rt] [HWASan] leave BufferedStackTrace uninit (#102247)
Otherwise we have to memset 2040 bytes (255 * 8) for each call to a malloc-like function. This caused noticable slowdown on AOSP.
1 parent a58f20b commit ee870e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-rt/lib/hwasan/hwasan.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ void hwasan_free(void *ptr, StackTrace *stack);
139139
void InstallAtExitHandler();
140140

141141
#define GET_MALLOC_STACK_TRACE \
142-
BufferedStackTrace stack; \
142+
UNINITIALIZED BufferedStackTrace stack; \
143143
if (hwasan_inited) \
144144
stack.Unwind(StackTrace::GetCurrentPc(), GET_CURRENT_FRAME(), \
145145
nullptr, common_flags()->fast_unwind_on_malloc, \
146146
common_flags()->malloc_context_size)
147147

148148
#define GET_FATAL_STACK_TRACE_PC_BP(pc, bp) \
149-
BufferedStackTrace stack; \
149+
UNINITIALIZED BufferedStackTrace stack; \
150150
if (hwasan_inited) \
151151
stack.Unwind(pc, bp, nullptr, common_flags()->fast_unwind_on_fatal)
152152

0 commit comments

Comments
 (0)