[PATCH] D38245: [Sanitizers] Allocator: new "release memory to OS" implementation

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:30:39 PDT 2017


eugenis added a comment.

Why are you mapping the counters in a specific place just after the free array, instead of simply anywhere? I.e. why MAP_FIXED at all?



================
Comment at: lib/sanitizer_common/sanitizer_allocator_primary64.h:317
+      counter_size_bits_log = Log2(counter_size_bits);
+      counter_mask = UINT64_MAX >> (sizeof(*buffer) * 8ULL - counter_size_bits);
+
----------------
Either use a named constant instead of UINT64_MAX, or use 8 instead of sizeof(*buffer).


================
Comment at: lib/sanitizer_common/sanitizer_allocator_primary64.h:772
+    ThisT* const allocator;
+    RegionInfo* const region;
+    const uptr region_base;
----------------
These are const pointers to mutable objects. What's the point?



https://reviews.llvm.org/D38245





More information about the llvm-commits mailing list