diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /memory/mozalloc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'memory/mozalloc')
-rw-r--r-- | memory/mozalloc/moz.build | 8 | ||||
-rw-r--r-- | memory/mozalloc/winheap.cpp | 55 |
2 files changed, 0 insertions, 63 deletions
diff --git a/memory/mozalloc/moz.build b/memory/mozalloc/moz.build index c5cd784607..bf73199810 100644 --- a/memory/mozalloc/moz.build +++ b/memory/mozalloc/moz.build @@ -21,14 +21,6 @@ if CONFIG["WRAP_STL_INCLUDES"]: "msvc_raise_wrappers.cpp", ] -if CONFIG["OS_TARGET"] == "WINNT": - # Don't build winheap.cpp when mozglue is a static library. - if CONFIG["MOZ_MEMORY"] or not CONFIG["JS_STANDALONE"]: - # Keep this file separate to avoid #include'ing windows.h everywhere. - SOURCES += [ - "winheap.cpp", - ] - UNIFIED_SOURCES += [ "mozalloc.cpp", "mozalloc_abort.cpp", diff --git a/memory/mozalloc/winheap.cpp b/memory/mozalloc/winheap.cpp deleted file mode 100644 index 1d2e1e5599..0000000000 --- a/memory/mozalloc/winheap.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * vim: sw=2 ts=4 et : - */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "mozilla/mozalloc.h" -#include <windows.h> - -#if !defined(MOZ_MEMORY) -# include <malloc.h> -# define malloc_impl malloc -# define calloc_impl calloc -# define realloc_impl realloc -# define free_impl free -#endif - -// Warning: C4273: 'HeapAlloc': inconsistent dll linkage -// The Windows headers define HeapAlloc as dllimport, but we define it as -// dllexport, which is a voluntary inconsistency. -#pragma warning(disable : 4273) - -MFBT_API -LPVOID WINAPI HeapAlloc(_In_ HANDLE hHeap, _In_ DWORD dwFlags, - _In_ SIZE_T dwBytes) { - if (dwFlags & HEAP_ZERO_MEMORY) { - return calloc_impl(1, dwBytes); - } - return malloc_impl(dwBytes); -} - -MFBT_API -LPVOID WINAPI HeapReAlloc(_In_ HANDLE hHeap, _In_ DWORD dwFlags, - _In_ LPVOID lpMem, _In_ SIZE_T dwBytes) { - // The HeapReAlloc contract is that failures preserve the existing - // allocation. We can't try to realloc in-place without possibly - // freeing the original allocation, breaking the contract. - // We also can't guarantee we zero all the memory from the end of - // the original allocation to the end of the new one because of the - // difference between the originally requested size and what - // malloc_usable_size would return us. - // So for both cases, just tell the caller we can't do what they - // requested. - if (dwFlags & (HEAP_REALLOC_IN_PLACE_ONLY | HEAP_ZERO_MEMORY)) { - return NULL; - } - return realloc_impl(lpMem, dwBytes); -} - -MFBT_API -BOOL WINAPI HeapFree(_In_ HANDLE hHeap, _In_ DWORD dwFlags, _In_ LPVOID lpMem) { - free_impl(lpMem); - return true; -} |