[PATCH] D94212: scudo: Add support for tracking stack traces of secondary allocations.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 15:47:10 PST 2021


eugenis added a comment.

Can we have a setting where the secondary ring buffer is used for primary allocations, too? The primary record could be pushed when the chunk is about to be reused.



================
Comment at: compiler-rt/lib/scudo/standalone/combined.h:1306
+    for (uptr I = Pos - 1; I != Pos - 1 - SecondaryRingBuffer::NumEntries;
+         --I) {
+      auto *Entry = &RingBuffer.Entries[I % SecondaryRingBuffer::NumEntries];
----------------
This loop seems expensive. Why not store alloc and dealloc as two independent events? It will use a bit more memory, but given the same memory budget, dealloc events should survive longer because they will be generally closer to the end of the ring (and they are the most interesting ones).



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94212/new/

https://reviews.llvm.org/D94212



More information about the llvm-commits mailing list