[compiler-rt] [scudo] [MTE] resize stack depot for allocation ring buffer (PR #74515)

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 20:00:01 PST 2024


================
@@ -1526,6 +1573,10 @@ class Allocator {
                              RawRingBufferMap.getCapacity());
     }
     RawRingBuffer = nullptr;
+    if (RawStackDepot) {
+      RawStackDepotMap.unmap(RawStackDepotMap.getBase(),
+                             RawStackDepotMap.getCapacity());
+    }
----------------
cferris1000 wrote:

As above, what does this mean? I don't see how this affects object bounds. To be fair, this code is incredibly hard to follow because of the way you are slicing memory and doing the casting and checking.

That's why I would suggest not allocating one big piece, but allocating separate pieces for each individual item. If you are worried about wasting memory, how much memory do you think you would waste? I think maybe it would get you an extra page or two at most. It would make the code easier to follow.

https://github.com/llvm/llvm-project/pull/74515


More information about the llvm-commits mailing list