Bug 1936728 - Use standard data types for MozVirtualAlloc() r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D235724
This commit is contained in:
@@ -1985,8 +1985,8 @@ StallSpecs GetAllocatorStallSpecs() {
|
|||||||
//
|
//
|
||||||
// Ref:
|
// Ref:
|
||||||
// https://docs.microsoft.com/en-us/troubleshoot/windows-client/performance/slow-page-file-growth-memory-allocation-errors
|
// https://docs.microsoft.com/en-us/troubleshoot/windows-client/performance/slow-page-file-growth-memory-allocation-errors
|
||||||
void* MozVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType,
|
void* MozVirtualAlloc(void* lpAddress, size_t dwSize, uint32_t flAllocationType,
|
||||||
DWORD flProtect) {
|
uint32_t flProtect) {
|
||||||
using namespace MozAllocRetries;
|
using namespace MozAllocRetries;
|
||||||
|
|
||||||
DWORD const lastError = ::GetLastError();
|
DWORD const lastError = ::GetLastError();
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#if defined(MOZ_MEMORY) && defined(XP_WIN)
|
#if defined(MOZ_MEMORY) && defined(XP_WIN)
|
||||||
# include <wtypes.h>
|
|
||||||
# include "mozmemory_wrap.h"
|
# include "mozmemory_wrap.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -46,8 +45,8 @@ struct StallSpecs {
|
|||||||
// ```
|
// ```
|
||||||
//
|
//
|
||||||
template <typename DelayFunc, typename OpFunc>
|
template <typename DelayFunc, typename OpFunc>
|
||||||
auto StallAndRetry(DelayFunc&& aDelayFunc,
|
auto StallAndRetry(DelayFunc&& aDelayFunc, OpFunc&& aOperation) const
|
||||||
OpFunc&& aOperation) const -> decltype(aOperation()) {
|
-> decltype(aOperation()) {
|
||||||
{
|
{
|
||||||
// Explicit typecheck for OpFunc, to provide an explicit error message.
|
// Explicit typecheck for OpFunc, to provide an explicit error message.
|
||||||
using detail::is_std_optional;
|
using detail::is_std_optional;
|
||||||
@@ -69,10 +68,9 @@ struct StallSpecs {
|
|||||||
|
|
||||||
#if defined(MOZ_MEMORY) && defined(XP_WIN)
|
#if defined(MOZ_MEMORY) && defined(XP_WIN)
|
||||||
MOZ_JEMALLOC_API StallSpecs GetAllocatorStallSpecs();
|
MOZ_JEMALLOC_API StallSpecs GetAllocatorStallSpecs();
|
||||||
MOZ_JEMALLOC_API_NODISCARD void* MozVirtualAlloc(LPVOID lpAddress,
|
MOZ_JEMALLOC_API_NODISCARD void* MozVirtualAlloc(void* lpAddress, size_t dwSize,
|
||||||
SIZE_T dwSize,
|
uint32_t flAllocationType,
|
||||||
DWORD flAllocationType,
|
uint32_t flProtect);
|
||||||
DWORD flProtect);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|||||||
Reference in New Issue
Block a user