proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
HugePages.h
Go to the documentation of this file.
1
/*
2
* Copyright 2012-present Facebook, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#include <sys/stat.h>
20
#include <sys/types.h>
21
#include <cstddef>
22
#include <string>
23
#include <utility>
24
#include <vector>
25
26
#include <boost/operators.hpp>
27
28
#include <
folly/Range.h
>
29
#include <
folly/experimental/io/FsUtil.h
>
30
#include <
folly/portability/Unistd.h
>
31
32
namespace
folly
{
33
34
struct
HugePageSize
:
private
boost::totally_ordered<HugePageSize> {
35
explicit
HugePageSize
(
size_t
s
) :
size
(s) {}
36
37
fs::path
filePath
(
const
fs::path& relpath)
const
{
38
return
mountPoint
/ relpath;
39
}
40
41
size_t
size
= 0;
42
fs::path
mountPoint
;
43
dev_t
device
= 0;
44
};
45
46
inline
bool
operator<
(
const
HugePageSize
&
a
,
const
HugePageSize
&
b
) {
47
return
a.
size
< b.
size
;
48
}
49
50
inline
bool
operator==
(
const
HugePageSize
&
a
,
const
HugePageSize
&
b
) {
51
return
a.
size
== b.
size
;
52
}
53
59
typedef
std::vector<HugePageSize>
HugePageSizeVec
;
60
65
const
HugePageSizeVec&
getHugePageSizes
();
66
72
const
HugePageSize
*
getHugePageSize
(
size_t
size
= 0);
73
78
const
HugePageSize
*
getHugePageSizeForDevice
(dev_t
device
);
79
80
}
// namespace folly
FsUtil.h
folly::HugePageSize::HugePageSize
HugePageSize(size_t s)
Definition:
HugePages.h:35
folly::getHugePageSizes
const HugePageSizeVec & getHugePageSizes()
Definition:
HugePages.cpp:201
b
char b
Definition:
OptionalTest.cpp:53
folly::HugePageSize::size
size_t size
Definition:
HugePages.h:41
folly::HugePageSize::mountPoint
fs::path mountPoint
Definition:
HugePages.h:42
folly::HugePageSizeVec
std::vector< HugePageSize > HugePageSizeVec
Definition:
HugePages.h:59
folly
—— Concurrent Priority Queue Implementation ——
Definition:
AtomicBitSet.h:29
folly::getHugePageSize
const HugePageSize * getHugePageSize(size_t size)
Definition:
HugePages.cpp:206
folly::getHugePageSizeForDevice
const HugePageSize * getHugePageSizeForDevice(dev_t device)
Definition:
HugePages.cpp:219
folly::HugePageSize::filePath
fs::path filePath(const fs::path &relpath) const
Definition:
HugePages.h:37
Range.h
Unistd.h
folly::HugePageSize::device
dev_t device
Definition:
HugePages.h:43
a
char a
Definition:
OptionalTest.cpp:53
folly::operator==
bool operator==(const Unexpected< Error > &lhs, const Unexpected< Error > &rhs)
Definition:
Expected.h:758
s
static set< string > s
Definition:
StringKeyedBenchmark.cpp:48
folly::HugePageSize
Definition:
HugePages.h:34
folly::operator<
std::enable_if< IsLessThanComparable< Value >::value, bool >::type operator<(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
Definition:
Expected.h:1321
proxygen
folly
folly
experimental
io
HugePages.h
Generated by
1.8.11