[PATCH] D85387: [NFC] Make argument name passed to `FindAvailableMemoryRange()` consistent with parameter name.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 10:59:02 PDT 2020


tejohnson added a comment.

In D85387#2200178 <https://reviews.llvm.org/D85387#2200178>, @yln wrote:

> I am okay with this change, but I don't understand this code or why this change is NFC.  Can we get @tejohnson to take a look? (D83247 <https://reviews.llvm.org/D83247>)
>
> `granularity` is not necessarily equal to `left_padding`.

It's NFC because min_shadow_base_alignment is always 0 for mac. We made this change to make the interface to, and the code within, the newly refactored MapDynamicShadow versions consistent. BTW the same issue exists in the win version, can you make the same change there? The linux version doesn't call FindAvailableMemoryRange(), so no issue there.

> Also `left_padding` already goes into `space_size`, which is also passed to `FindAvailableMemoryRange()`.
>
>   const uptr granularity = GetMmapGranularity();
>   ...
>   const uptr left_padding =
>       Max<uptr>(granularity, 1ULL << min_shadow_base_alignment);
>   
>   uptr space_size = shadow_size_bytes + left_padding;
>   
>   ...
>   uptr shadow_start =
>       FindAvailableMemoryRange(space_size, alignment, granularity, ...);




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85387



More information about the llvm-commits mailing list