diff options
| author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-02-28 03:42:07 +0000 | 
|---|---|---|
| committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2019-02-28 03:42:07 +0000 | 
| commit | 14d58f598691b8c27d8b4a4cf6181178f1a8c295 (patch) | |
| tree | 79c8c826033313ac2003b61fde1c8eac50be91bd | |
| parent | 68c4827660e0356d6fae02406018161d76a0c3f2 (diff) | |
| download | bcm5719-llvm-14d58f598691b8c27d8b4a4cf6181178f1a8c295.tar.gz bcm5719-llvm-14d58f598691b8c27d8b4a4cf6181178f1a8c295.zip  | |
Fix SupportTests.exe/AllocationTests/MappedMemoryTest.AllocAndReleaseHuge when the machine doesn't have large pages enabled.
llvm-svn: 355067
| -rw-r--r-- | llvm/lib/Support/Windows/Memory.inc | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/Windows/Memory.inc b/llvm/lib/Support/Windows/Memory.inc index 7153bf931e7..0e961fdeaad 100644 --- a/llvm/lib/Support/Windows/Memory.inc +++ b/llvm/lib/Support/Windows/Memory.inc @@ -110,16 +110,16 @@ MemoryBlock Memory::allocateMappedMemory(size_t NumBytes,      return MemoryBlock();    static size_t DefaultGranularity = getAllocationGranularity(); -  static Optional<size_t> LargePageGranularity = enableProcessLargePages(); +  static size_t LargePageGranularity = enableProcessLargePages();    DWORD AllocType = MEM_RESERVE | MEM_COMMIT;    bool HugePages = false;    size_t Granularity = DefaultGranularity; -  if ((Flags & MF_HUGE_HINT) && LargePageGranularity.hasValue()) { +  if ((Flags & MF_HUGE_HINT) && LargePageGranularity > 0) {      AllocType |= MEM_LARGE_PAGES;      HugePages = true; -    Granularity = *LargePageGranularity; +    Granularity = LargePageGranularity;    }    size_t NumBlocks = (NumBytes + Granularity - 1) / Granularity;  | 

