proxygen
|
#include <folly/detail/MemoryIdler.h>
#include <folly/portability/GMock.h>
#include <folly/portability/GTest.h>
#include <folly/synchronization/Baton.h>
#include <memory>
#include <thread>
Go to the source code of this file.
Classes | |
struct | MockClock |
struct | MockAtom< T > |
Functions | |
TEST (MemoryIdler, releaseStack) | |
TEST (MemoryIdler, releaseStackMinExtra) | |
TEST (MemoryIdler, releaseStackLargeExtra) | |
TEST (MemoryIdler, releaseMallocTLS) | |
FutexResult | futexWait (const Futex< MockAtom > *futex, uint32_t expected, uint32_t waitMask) |
template<typename Clock , typename Duration > | |
FutexResult | futexWaitUntil (const Futex< MockAtom > *futex, std::uint32_t expected, std::chrono::time_point< Clock, Duration > const &deadline, uint32_t waitMask) |
TEST (MemoryIdler, futexWaitValueChangedEarly) | |
TEST (MemoryIdler, futexWaitValueChangedLate) | |
TEST (MemoryIdler, futexWaitAwokenEarly) | |
TEST (MemoryIdler, futexWaitAwokenLate) | |
TEST (MemoryIdler, futexWaitImmediateFlush) | |
TEST (MemoryIdler, futexWaitNeverFlush) | |
Variables | |
static auto const | forever = MockClock::time_point::max() |
FutexResult futexWait | ( | const Futex< MockAtom > * | futex, |
uint32_t | expected, | ||
uint32_t | waitMask | ||
) |
Definition at line 97 of file MemoryIdlerTest.cpp.
FutexResult futexWaitUntil | ( | const Futex< MockAtom > * | futex, |
std::uint32_t | expected, | ||
std::chrono::time_point< Clock, Duration > const & | deadline, | ||
uint32_t | waitMask | ||
) |
Definition at line 101 of file MemoryIdlerTest.cpp.
Referenced by folly::fibers::Baton::timedWaitThread().
TEST | ( | MemoryIdler | , |
releaseStack | |||
) |
Definition at line 30 of file MemoryIdlerTest.cpp.
References folly::detail::MemoryIdler::unmapUnusedStack().
TEST | ( | MemoryIdler | , |
releaseStackMinExtra | |||
) |
Definition at line 34 of file MemoryIdlerTest.cpp.
References folly::detail::MemoryIdler::unmapUnusedStack().
TEST | ( | MemoryIdler | , |
releaseStackLargeExtra | |||
) |
Definition at line 38 of file MemoryIdlerTest.cpp.
References folly::detail::MemoryIdler::unmapUnusedStack().
TEST | ( | MemoryIdler | , |
releaseMallocTLS | |||
) |
Definition at line 42 of file MemoryIdlerTest.cpp.
References folly::detail::MemoryIdler::flushLocalMallocCaches().
TEST | ( | MemoryIdler | , |
futexWaitValueChangedEarly | |||
) |
Definition at line 109 of file MemoryIdlerTest.cpp.
References folly::test::begin(), folly::detail::MemoryIdler::defaultIdleTimeout, EXPECT_CALL, EXPECT_EQ, forever, folly::detail::futexWaitUntil(), folly::detail::MemoryIdler::futexWaitUntil(), testing::Ge(), folly::AtomicStruct< T, Atom >::load(), testing::Lt(), testing::Return(), MockClock::setup(), and folly::detail::VALUE_CHANGED.
TEST | ( | MemoryIdler | , |
futexWaitValueChangedLate | |||
) |
Definition at line 125 of file MemoryIdlerTest.cpp.
References folly::test::begin(), folly::detail::MemoryIdler::defaultIdleTimeout, EXPECT_CALL, EXPECT_EQ, forever, folly::detail::futexWaitUntil(), folly::detail::MemoryIdler::futexWaitUntil(), testing::Ge(), folly::AtomicStruct< T, Atom >::load(), testing::Lt(), testing::Return(), MockClock::setup(), folly::detail::TIMEDOUT, and folly::detail::VALUE_CHANGED.
TEST | ( | MemoryIdler | , |
futexWaitAwokenEarly | |||
) |
Definition at line 143 of file MemoryIdlerTest.cpp.
References folly::detail::AWOKEN, folly::test::begin(), folly::detail::MemoryIdler::defaultIdleTimeout, EXPECT_CALL, EXPECT_EQ, forever, folly::detail::futexWaitUntil(), folly::detail::MemoryIdler::futexWaitUntil(), testing::Ge(), folly::AtomicStruct< T, Atom >::load(), testing::Return(), and MockClock::setup().
TEST | ( | MemoryIdler | , |
futexWaitAwokenLate | |||
) |
Definition at line 155 of file MemoryIdlerTest.cpp.
References folly::detail::AWOKEN, folly::test::begin(), folly::detail::MemoryIdler::defaultIdleTimeout, EXPECT_CALL, EXPECT_EQ, f, forever, folly::detail::futexWaitUntil(), folly::detail::MemoryIdler::futexWaitUntil(), folly::AtomicStruct< T, Atom >::load(), testing::Return(), MockClock::setup(), and folly::detail::TIMEDOUT.
TEST | ( | MemoryIdler | , |
futexWaitImmediateFlush | |||
) |
Definition at line 171 of file MemoryIdlerTest.cpp.
References folly::detail::AWOKEN, EXPECT_CALL, EXPECT_EQ, forever, folly::detail::futexWaitUntil(), folly::detail::MemoryIdler::futexWaitUntil(), testing::Return(), and MockClock::setup().
TEST | ( | MemoryIdler | , |
futexWaitNeverFlush | |||
) |
Definition at line 183 of file MemoryIdlerTest.cpp.
References folly::detail::AWOKEN, EXPECT_CALL, EXPECT_EQ, forever, folly::detail::futexWaitUntil(), folly::detail::MemoryIdler::futexWaitUntil(), testing::Return(), and MockClock::setup().
|
static |