[PATCH] D74696: [scudo][standalone] Shift some data from dynamic to static

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 07:39:35 PST 2020


hctim accepted this revision.
hctim added a comment.
This revision is now accepted and ready to land.

LGTM w/ nits



================
Comment at: compiler-rt/lib/scudo/standalone/bytemap.h:23
+    memset(Map, 0, sizeof(Map));
+    initLinkerInitialized();
   }
----------------
Nit: remove


================
Comment at: compiler-rt/lib/scudo/standalone/release.h:43
 // A packed array of Counters. Each counter occupies 2^N bits, enough to store
 // counter's MaxValue. Ctor will try to allocate the required Buffer via map()
 // and the caller is expected to check whether the initialization was successful
----------------
Update?


================
Comment at: compiler-rt/lib/scudo/standalone/release.h:70
                  sizeof(*Buffer);
-    Buffer = reinterpret_cast<uptr *>(
-        map(nullptr, BufferSize, "scudo:counters", MAP_ALLOWNOMEM));
+    if (BufferSize <= sizeof(StaticBuffer) && Mutex.tryLock()) {
+      Buffer = &StaticBuffer[0];
----------------
nit: `sizeof(StaticBuffer)` should be a constant somewhere


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74696





More information about the llvm-commits mailing list