Commit 73ec90e1 authored by Paul Bone's avatar Paul Bone
Browse files

Bug 1828599 - Assert if mprotect/VirtualFree fails r=glandium

parent 60b99c8a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1167,14 +1167,15 @@ static void FreePage(GMutLock aLock, uintptr_t aIndex,
                     const Maybe<arena_id_t>& aArenaId,
                     const StackTrace& aFreeStack, Delay aReuseDelay) {
  void* pagePtr = gConst->AllocPagePtr(aIndex);

#ifdef XP_WIN
  if (!VirtualFree(pagePtr, kPageSize, MEM_DECOMMIT)) {
    return;
    MOZ_CRASH("VirtualFree failed");
  }
#else
  if (mmap(pagePtr, kPageSize, PROT_NONE, MAP_FIXED | MAP_PRIVATE | MAP_ANON,
           -1, 0) == MAP_FAILED) {
    return;
    MOZ_CRASH("mmap failed");
  }
#endif