[PATCH] D43318: [asan] Be more careful and verbose when allocating dynamic shadow memory

George Karpenkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 17:48:30 PST 2018


george.karpenkov added inline comments.


================
Comment at: lib/asan/asan_mac.cc:75
     uptr new_max_vm = RoundDownTo(largest_gap_found << SHADOW_SCALE, alignment);
+    if (new_max_vm < max_occupied_vm) {
+      Report("Unable to find a memory range for dynamic shadow.\n");
----------------
kubamracek wrote:
> george.karpenkov wrote:
> > I don't quite understand semantics here.
> > `max_occupied_vm` to me means "maximal size of occupied virtual memory".
> > Then why it's a problem if a new maximal size is smaller? Shouldn't it be a problem if it's larger?
> `max_occupied_vm` is the largest address that it already occupied by something. We're trying to restrict the VM space with `new_max_vm` being the new VM limit. This check is to make sure we don't restrict too much (which would overwrite memory that is already used).
> 
> Suggestions for better name of `max_occupied_vm`?
`largest_occupied_vm`? Almost the same, but at least to me does quite have same connotation, but that's a not important nit.. In any case, maybe this should be explained in a doxygen comment for `FindAvailableMemoryRange`?


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43318





More information about the llvm-commits mailing list