33 double* d =
m.asWritableRange<
double>().
data();
42 const double* d =
m.asRange<
double>().
data();
52 double* d =
m.asWritableRange<
double>().
data();
60 const double* d =
m.asRange<
double>().
data();
75 const double* dr = mr.asRange<
double>().
data();
87 void writeStringToFileOrDie(
const std::string& str,
int fd) {
88 const char*
b = str.c_str();
89 size_t count = str.size();
90 ssize_t total_bytes = 0;
93 r =
write(fd, b, count);
104 }
while (r != 0 && count);
111 writeStringToFileOrDie(
"hello", f.
fd());
125 size_t fileSize = sysconf(_SC_PAGESIZE) * 3 + 10;
126 fileData.reserve(fileSize);
127 for (
size_t i = 0;
i < fileSize;
i++) {
132 writeStringToFileOrDie(fileData, f.
fd());
139 size_t size = sysconf(_SC_PAGESIZE) * 2;
157 size_t size = kPageSize + 10;
164 m.
advise(MADV_NORMAL, 0, kPageSize);
165 m.
advise(MADV_NORMAL, 1, kPageSize);
166 m.
advise(MADV_NORMAL, 0, 2);
167 m.
advise(MADV_NORMAL, 1, 2);
169 m.
advise(MADV_NORMAL, kPageSize, 0);
170 m.
advise(MADV_NORMAL, kPageSize, 1);
171 m.
advise(MADV_NORMAL, kPageSize, size - kPageSize);
173 auto off = kPageSize + 1;
174 m.
advise(MADV_NORMAL, off, size - off);
176 EXPECT_DEATH(m.
advise(MADV_NORMAL, off, size - off + 1),
"");
void write(const T &in, folly::io::Appender &appender)
#define EXPECT_EQ(val1, val2)
constexpr detail::Map< Move > move
constexpr size_type size() const
—— Concurrent Priority Queue Implementation ——
bool mlock(LockMode lock)
static constexpr double kSomeDouble
constexpr auto size(C const &c) -> decltype(c.size())
Range< T * > asWritableRange() const
constexpr auto data(C &c) -> decltype(c.data())
void advise(int advice) const
static map< string, int > m
static Options writable()
Range< const T * > asRange() const
#define EXPECT_TRUE(condition)
#define EXPECT_NE(val1, val2)
int ftruncateNoInt(int fd, off_t len)
TEST(SequencedExecutor, CPUThreadPoolExecutor)