#include "base/memory/shared_memory_security_policy.h"
#include <algorithm>
#include <atomic>
#include <limits>
#include <optional>
#include "base/bits.h"
#include "base/memory/page_size.h"
#include "base/numerics/checked_math.h"
#include "build/build_config.h"
namespace base {
namespace {
#if defined(ARCH_CPU_32_BITS) || BUILDFLAG(IS_NACL)
constexpr size_t kTotalMappedSizeLimit = std::numeric_limits<size_t>::max();
#elif defined(ARCH_CPU_64_BITS)
constexpr size_t kTotalMappedSizeLimit = …;
#endif
static std::atomic_size_t total_mapped_size_;
std::optional<size_t> AlignWithPageSize(size_t size) { … }
}
bool SharedMemorySecurityPolicy::AcquireReservationForMapping(size_t size) { … }
void SharedMemorySecurityPolicy::ReleaseReservationForMapping(size_t size) { … }
}