Bug 1804499 - [4/4] Expose allocator's stall-specs beyond mozjemalloc.cpp r=glandium

Export `GetStallSpecs` as `mozilla::GetAllocatorStallSpecs`, when it exists.

Differential Revision: https://phabricator.services.mozilla.com/D165430
This commit is contained in:
Ray Kraesig 2023-01-19 16:16:43 +00:00
parent 0336c0891c
commit 611b09e06e
2 changed files with 15 additions and 0 deletions

View File

@ -1573,6 +1573,13 @@ static inline StallSpecs GetStallSpecs() {
} // namespace MozAllocRetries
using MozAllocRetries::MozVirtualAlloc;
namespace mozilla {
MOZ_JEMALLOC_API StallSpecs GetAllocatorStallSpecs() {
return ::MozAllocRetries::GetStallSpecs();
}
} // namespace mozilla
#endif // XP_WIN
// ***************************************************************************

View File

@ -10,6 +10,10 @@
#include <optional>
#include <type_traits>
#if defined(MOZ_MEMORY) && defined(XP_WIN)
# include "mozmemory_wrap.h"
#endif
namespace mozilla {
namespace detail {
@ -62,6 +66,10 @@ struct StallSpecs {
}
};
#if defined(MOZ_MEMORY) && defined(XP_WIN)
MOZ_JEMALLOC_API StallSpecs GetAllocatorStallSpecs();
#endif
} // namespace mozilla
#endif // mozjemalloc_utils_h