[PATCH] D40754: [sanitizer] 64-bit allocator's PopulateFreeArray partial refactor

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 15:00:59 PST 2017


cryptoad added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_allocator_primary64.h:723
+      region->mapped_meta += meta_map_size;
     }
 
----------------
alekseyshl wrote:
> I'd suggest to wrap the entire metadata allocating block (from // Calculate the required space for metadata) with:
> 
>   if (kMetadataSize) {
>     ...
>   }
So I thought about it, but I was wondering about something: currently the check for exhaustion will be done whether or not we use metadata.
I wanted to leave it like that at first, because it sort of made sense.
But then I figure that if we are not using metadata, and are exhausted, then the initial mmap would fail anyway since we'd hit the free array.
It seems to be safe to place all of this within `if (kMetadataSize)`, but I wanted to raise this to your attention and get your feedback.


https://reviews.llvm.org/D40754





More information about the llvm-commits mailing list