summaryrefslogtreecommitdiff
path: root/chromium/sandbox/constants.h
blob: 3e0ebc16fe42dfd412dcc0885dfaad9f77b7b59f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SANDBOX_CONSTANTS_H_
#define SANDBOX_CONSTANTS_H_

#include <limits>

#include "build/build_config.h"

namespace sandbox {

// kDataSizeLimit is used for RLIMIT_DATA on POSIX and for
// JOBOBJECT_EXTENDED_LIMIT_INFORMATION.JobMemoryLimit on Windows.
//
#if defined(ARCH_CPU_64_BITS)
constexpr size_t kDataSizeLimit = size_t{1} << 34;  // 16 GB
#else
// Limit the data memory to a size that prevents allocations that can't be
// indexed by an int.
constexpr size_t kDataSizeLimit =
    static_cast<size_t>(std::numeric_limits<int>::max());
#endif

}  // namespace sandbox

#endif  // SANDBOX_CONSTANTS_H_