From c5739e2655474a52ae4ce42d42dbda32a46a7178 Mon Sep 17 00:00:00 2001 From: Masatoshi Kimura Date: Wed, 26 Jul 2023 08:52:54 +0000 Subject: [PATCH] Bug 1844908 - Remove pre-Win10-specific codepath from xpcom/. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D184308 --- xpcom/base/AvailableMemoryTracker.cpp | 14 +++++--------- xpcom/glue/standalone/nsXPCOMGlue.cpp | 8 -------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/xpcom/base/AvailableMemoryTracker.cpp b/xpcom/base/AvailableMemoryTracker.cpp index 5e75f26ac6c4..83a2035e81b1 100644 --- a/xpcom/base/AvailableMemoryTracker.cpp +++ b/xpcom/base/AvailableMemoryTracker.cpp @@ -7,7 +7,7 @@ #include "mozilla/AvailableMemoryTracker.h" #if defined(XP_WIN) -# include "mozilla/WindowsVersion.h" +# include # include "nsIMemoryReporter.h" #endif @@ -116,15 +116,11 @@ nsJemallocFreeDirtyPagesRunnable::Run() { #if defined(XP_WIN) void nsJemallocFreeDirtyPagesRunnable::OptimizeSystemHeap() { - // HeapSetInformation exists prior to Windows 8.1, but the - // HeapOptimizeResources information class does not. - if (IsWin8Point1OrLater()) { - HEAP_OPTIMIZE_RESOURCES_INFORMATION heapOptInfo = { - HEAP_OPTIMIZE_RESOURCES_CURRENT_VERSION}; + HEAP_OPTIMIZE_RESOURCES_INFORMATION heapOptInfo = { + HEAP_OPTIMIZE_RESOURCES_CURRENT_VERSION}; - ::HeapSetInformation(nullptr, HeapOptimizeResources, &heapOptInfo, - sizeof(heapOptInfo)); - } + ::HeapSetInformation(nullptr, HeapOptimizeResources, &heapOptInfo, + sizeof(heapOptInfo)); } #endif // defined(XP_WIN) diff --git a/xpcom/glue/standalone/nsXPCOMGlue.cpp b/xpcom/glue/standalone/nsXPCOMGlue.cpp index 09edef10ee91..0e2efb3197e8 100644 --- a/xpcom/glue/standalone/nsXPCOMGlue.cpp +++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp @@ -38,7 +38,6 @@ using LibHandleResult = ::mozilla::Result; #if defined(XP_WIN) # include -# include "mozilla/WindowsVersion.h" # include "mozilla/PreXULSkeletonUI.h" static LibHandleResult GetLibHandle(pathstr_t aDependentLib) { @@ -301,13 +300,6 @@ static XPCOMGlueLoadResult XPCOMGlueLoad( if (l == 0 || *buffer == '#') { continue; } -# ifdef XP_WIN - // There is no point in reading Universal CRT forwarder DLLs ahead on - // Windows 10 because they will not be touched later. - if (IsWin10OrLater() && !strncmp(buffer, "api-", 4)) { - continue; - } -# endif // cut the trailing newline, if present if (buffer[l - 1] == '\n') {