blob: 7fa11cf7e5cd0abacd672801dd957c93518d742a [file] [log] [blame]
Chris Palmer17b419492018-07-10 00:38:481// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SANDBOX_CONSTANTS_H_
6#define SANDBOX_CONSTANTS_H_
7
8#include <limits>
9
10#include "build/build_config.h"
11
12namespace sandbox {
13
14// kDataSizeLimit is used for RLIMIT_DATA on POSIX and for
15// JOBOBJECT_EXTENDED_LIMIT_INFORMATION.JobMemoryLimit on Windows.
16//
17#if defined(ARCH_CPU_64_BITS)
18const size_t kDataSizeLimit = 1ULL << 32;
19#else
20// Limit the data memory to a size that prevents allocations that can't be
21// indexed by an int.
22const size_t kDataSizeLimit =
23 static_cast<size_t>(std::numeric_limits<int>::max());
24#endif
25
26} // namespace sandbox
27
28#endif // SANDBOX_CONSTANTS_H_