proxygen
|
Namespaces | |
apply_tuple | |
atomic_notification | |
concurrenthashmap | |
distributed_mutex | |
fixedstring | |
function | |
impl | |
member | |
partial | |
propagate_const_adl | |
Typedefs | |
using | TimeIterPair = std::pair< std::chrono::high_resolution_clock::duration, unsigned int > |
using | BenchmarkFun = std::function< detail::TimeIterPair(unsigned int)> |
template<typename Rep , typename Period > | |
using | IntermediateDuration = std::chrono::duration< typename IntermediateTimeRep< Rep, std::is_floating_point< Rep >::value, std::is_signed< Rep >::value >::type, std::ratio< 1, Period::den >> |
template<typename T > | |
using | TransparentlyConvertibleToRange = std::is_convertible< T, Range< typename ValueTypeForTransparentConversionToRange< T >::type const * >> |
template<typename Tgt , typename Src > | |
using | IsArithToArith = bool_constant< !std::is_same< Tgt, Src >::value &&!std::is_same< Tgt, bool >::value &&std::is_arithmetic< Src >::value &&std::is_arithmetic< Tgt >::value > |
template<typename Tgt > | |
using | ParseToResult = decltype(parseTo(StringPiece{}, std::declval< Tgt & >())) |
template<typename Tgt > | |
using | ParseToError = ExpectedErrorType< decltype(detail::parseToWrap(StringPiece{}, std::declval< Tgt & >()))> |
template<template< typename > class Atom = std::atomic> | |
using | Futex = Atom< std::uint32_t > |
template<bool B> | |
using | Bool = bool_constant< B > |
using | True = std::true_type |
using | False = std::false_type |
template<class Fn , class... Ts> | |
using | MetaApply = typename Fn::template apply< Ts... > |
template<bool If_, class Then , class Else > | |
using | If = MetaApply< impl::If_< If_ >, Then, Else > |
template<template< class... > class C> | |
using | MetaQuoteTrait = MetaCompose< MetaQuote< _t >, MetaQuote< C >> |
template<class Fn > | |
using | MetaCurry = MetaCompose< Fn, MetaQuote< TypeList >> |
template<class Fn > | |
using | MetaUncurry = MetaBindBack< MetaQuote< MetaApply >, Fn > |
template<class List , class... Ts> | |
using | TypePushBack = MetaApply< List, MetaBindBack< MetaQuote< TypeList >, Ts... >> |
template<class List , class... Ts> | |
using | TypePushFront = MetaApply< List, MetaBindFront< MetaQuote< TypeList >, Ts... >> |
template<class Fn , class List > | |
using | MetaUnpack = MetaApply< List, Fn > |
template<class List , class Fn > | |
using | TypeTransform = MetaApply< List, impl::TypeTransform_< Fn >> |
template<class List , class State , class Fn > | |
using | TypeFold = MetaApply< MetaApply< List, impl::FoldR_< Fn >>, State > |
template<class List , class State , class Fn > | |
using | TypeReverseFold = MetaApply< MetaApply< List, impl::FoldL_< Fn >>, State > |
template<class List > | |
using | Inherit = impl::Inherit_< List > |
template<class List > | |
using | TypeUnique = TypeFold< List, TypeList<>, impl::Unique_ > |
template<class List > | |
using | TypeReverseUnique = TypeReverseFold< List, TypeList<>, MetaFlip< impl::Unique_ >> |
template<class T > | |
using | AsTypeList = _t< impl::AsTypeList_< T >> |
template<class List > | |
using | TypeJoin = MetaApply< TypeFold< List, MetaQuote< TypeList >, impl::Join_ >> |
template<class... Ts> | |
using | TypeConcat = TypeJoin< TypeList< Ts... >> |
template<typename Fn > | |
using | ArgumentTypes = typename ArgumentTypesByKind< IdentifyCallable::getKind< Fn >(), Fn >::type |
template<typename... Args> | |
using | EnableForArgTypes = typename std::enable_if< HasArgumentTypes< Args... >::value, void >::type |
template<size_t Deg> | |
using | poly_table = std::array< std::array< std::array< uint64_t, poly_size(Deg)>, 256 >, 8 > |
using | max_align_v_ = max_align_t_< long double, double, float, long long int, long int, int, short int, bool, char, char16_t, char32_t, wchar_t, void *, std::max_align_t > |
template<typename T > | |
using | is_decay_propagate_const = is_propagate_const< _t< std::decay< T >>> |
template<typename N , typename D > | |
using | IdivResultType = typename std::enable_if< std::is_integral< N >::value &&std::is_integral< D >::value &&!std::is_same< N, bool >::value &&!std::is_same< D, bool >::value, decltype(N{1}/D{1})>::type |
template<typename RNG > | |
using | StateSizeT = _t< StateSize< RNG >> |
template<typename F , bool INE> | |
using | ScopeGuardImplDecay = ScopeGuardImpl< typename std::decay< F >::type, INE > |
template<class SynchronizedType > | |
using | SynchronizedDataType = typename std::conditional< std::is_const< SynchronizedType >::value, typename SynchronizedType::DataType const, typename SynchronizedType::DataType >::type |
template<class SynchronizedType > | |
using | LockedPtrType = typename std::conditional< std::is_const< SynchronizedType >::value, typename SynchronizedType::ConstLockedPtr, typename SynchronizedType::LockedPtr >::type |
Enumerations | |
enum | FutexResult { FutexResult::VALUE_CHANGED, FutexResult::AWOKEN, FutexResult::INTERRUPTED, FutexResult::TIMEDOUT } |
enum | MutexLevel { MutexLevel::UNIQUE, MutexLevel::SHARED, MutexLevel::UPGRADE } |
enum | ScopeGuardOnExit |
enum | spin_result { spin_result::success, spin_result::timeout, spin_result::advance } |
Functions | |
template<typename NotKeyT , typename KeyT > | |
void | checkLegalKeyIfKeyTImpl (NotKeyT, KeyT, KeyT, KeyT) |
template<typename KeyT > | |
void | checkLegalKeyIfKeyTImpl (KeyT key_in, KeyT emptyKey, KeyT lockedKey, KeyT erasedKey) |
void | addBenchmarkImpl (const char *file, const char *name, std::function< TimeIterPair(unsigned int)>) |
template<typename Src > | |
Expected< time_t, ConversionCode > | chronoRangeCheck (Src value) |
template<typename SubsecondRatio , typename Rep > | |
static Expected< std::pair< time_t, long >, ConversionCode > | durationToPosixTime (const std::chrono::duration< Rep, std::ratio< 1, 1 >> &duration) |
template<typename SubsecondRatio , typename Rep , std::intmax_t Denominator> | |
static Expected< std::pair< time_t, long >, ConversionCode > | durationToPosixTime (const std::chrono::duration< Rep, std::ratio< 1, Denominator >> &duration) |
template<typename SubsecondRatio , typename Rep , std::intmax_t Numerator> | |
static Expected< std::pair< time_t, long >, ConversionCode > | durationToPosixTime (const std::chrono::duration< Rep, std::ratio< Numerator, 1 >> &duration) |
template<typename SubsecondRatio , typename Rep , typename Period > | |
Expected< std::pair< time_t, long >, ConversionCode > | durationToPosixTime (const std::chrono::duration< Rep, Period > &duration) |
template<typename SubsecondRatio , typename Seconds , typename Subseconds , typename Rep > | |
auto | posixTimeToDuration (Seconds seconds, Subseconds subseconds, std::chrono::duration< Rep, std::ratio< 1, 1 >> dummy) -> Expected< decltype(dummy), ConversionCode > |
template<typename SubsecondRatio , typename Seconds , typename Subseconds , typename Rep , std::intmax_t Denominator> | |
auto | posixTimeToDuration (Seconds seconds, Subseconds subseconds, std::chrono::duration< Rep, std::ratio< 1, Denominator >> dummy) -> Expected< decltype(dummy), ConversionCode > |
template<typename SubsecondRatio , typename Seconds , typename Subseconds , typename Rep , std::intmax_t Numerator> | |
auto | posixTimeToDuration (Seconds seconds, Subseconds subseconds, std::chrono::duration< Rep, std::ratio< Numerator, 1 >> dummy) -> Expected< decltype(dummy), ConversionCode > |
template<typename SubsecondRatio , typename Seconds , typename Subseconds , typename Rep , std::intmax_t Denominator, std::intmax_t Numerator> | |
auto | posixTimeToDuration (Seconds seconds, Subseconds subseconds, std::chrono::duration< Rep, std::ratio< Numerator, Denominator >> dummy) -> Expected< decltype(dummy), ConversionCode > |
template<typename Tgt , typename SubsecondRatio , typename Seconds , typename Subseconds > | |
Expected< Tgt, ConversionCode > | tryPosixTimeToDuration (Seconds seconds, Subseconds subseconds) |
template<typename T > | |
constexpr T | constexpr_log2_ (T a, T e) |
template<typename T > | |
constexpr T | constexpr_log2_ceil_ (T l2, T t) |
template<typename T > | |
constexpr T | constexpr_square_ (T t) |
template<typename U > | |
constexpr std::size_t | constexpr_find_first_set_ (std::size_t s, std::size_t a, U const u) |
template<typename D , typename S > | |
constexpr D | constexpr_clamp_cast_helper (S src, S sl, S su, D dl, D du) |
template<class Iterator > | |
FOLLY_ALWAYS_INLINE auto | getPointer (const Iterator &it, long) -> decltype(std::addressof(*it)) |
template<class Iterator > | |
FOLLY_ALWAYS_INLINE auto | getPointer (const Iterator &it, int) -> decltype(it.operator->()) |
template<class T , class U > | |
std::enable_if< (std::is_arithmetic< T >::value &&std::is_arithmetic< U >::value)||(std::is_pointer< T >::value &&std::is_pointer< U >::value), bool >::type | notThereYet (T &iter, const U &end) |
template<class T , class U > | |
std::enable_if< !((std::is_arithmetic< T >::value &&std::is_arithmetic< U >::value)||(std::is_pointer< T >::value &&std::is_pointer< U >::value)), bool >::type | notThereYet (T &iter, const U &end) |
template<class T , class U > | |
std::enable_if< HasLess< U, T >::value, bool >::type | downTo (T &iter, const U &begin) |
template<class T , class U > | |
std::enable_if<!HasLess< U, T >::value, bool >::type | downTo (T &iter, const U &begin) |
template<typename Arg > | |
decltype(auto) | unwrap_emplace_arg (Arg &&arg) noexcept |
template<typename Arg > | |
decltype(auto) | unwrap_emplace_arg (std::reference_wrapper< Arg > arg) noexcept |
template<typename Arg > | |
decltype(auto) | unwrap_emplace_arg (folly::rvalue_reference_wrapper< Arg > arg) noexcept |
Expected< bool, ConversionCode > | str_to_bool (StringPiece *src) noexcept |
template<class Tgt > | |
Expected< Tgt, ConversionCode > | str_to_floating (StringPiece *src) noexcept |
template Expected< float, ConversionCode > | str_to_floating< float > (StringPiece *src) noexcept |
template Expected< double, ConversionCode > | str_to_floating< double > (StringPiece *src) noexcept |
template<class Tgt > | |
Expected< Tgt, ConversionCode > | digits_to (const char *b, const char *const e) noexcept |
template Expected< char, ConversionCode > | digits_to< char > (const char *, const char *) noexcept |
template Expected< signed char, ConversionCode > | digits_to< signed char > (const char *, const char *) noexcept |
template Expected< unsigned char, ConversionCode > | digits_to< unsigned char > (const char *, const char *) noexcept |
template Expected< short, ConversionCode > | digits_to< short > (const char *, const char *) noexcept |
template Expected< unsigned short, ConversionCode > | digits_to< unsigned short > (const char *, const char *) noexcept |
template Expected< int, ConversionCode > | digits_to< int > (const char *, const char *) noexcept |
template Expected< unsigned int, ConversionCode > | digits_to< unsigned int > (const char *, const char *) noexcept |
template Expected< long, ConversionCode > | digits_to< long > (const char *, const char *) noexcept |
template Expected< unsigned long, ConversionCode > | digits_to< unsigned long > (const char *, const char *) noexcept |
template Expected< long long, ConversionCode > | digits_to< long long > (const char *, const char *) noexcept |
template Expected< unsigned long long, ConversionCode > | digits_to< unsigned long long > (const char *, const char *) noexcept |
template<class Tgt > | |
Expected< Tgt, ConversionCode > | str_to_integral (StringPiece *src) noexcept |
template Expected< char, ConversionCode > | str_to_integral< char > (StringPiece *src) noexcept |
template Expected< signed char, ConversionCode > | str_to_integral< signed char > (StringPiece *src) noexcept |
template Expected< unsigned char, ConversionCode > | str_to_integral< unsigned char > (StringPiece *src) noexcept |
template Expected< short, ConversionCode > | str_to_integral< short > (StringPiece *src) noexcept |
template Expected< unsigned short, ConversionCode > | str_to_integral< unsigned short > (StringPiece *src) noexcept |
template Expected< int, ConversionCode > | str_to_integral< int > (StringPiece *src) noexcept |
template Expected< unsigned int, ConversionCode > | str_to_integral< unsigned int > (StringPiece *src) noexcept |
template Expected< long, ConversionCode > | str_to_integral< long > (StringPiece *src) noexcept |
template Expected< unsigned long, ConversionCode > | str_to_integral< unsigned long > (StringPiece *src) noexcept |
template Expected< long long, ConversionCode > | str_to_integral< long long > (StringPiece *src) noexcept |
template Expected< unsigned long long, ConversionCode > | str_to_integral< unsigned long long > (StringPiece *src) noexcept |
ConversionCode | enforceWhitespaceErr (StringPiece sp) |
void | enforceWhitespace (StringPiece sp) |
template<typename... Ts> | |
auto | getLastElement (const Ts &...ts) -> decltype(LastElementImpl< Ts... >::call(ts...)) |
template<class Tgt > | |
std::enable_if< !std::is_same< Tgt, bool >::value &&(std::is_integral< Tgt >::value||std::is_floating_point< Tgt >::value), Expected< Tgt, ConversionCode > >::type | convertTo (const bool &value) noexcept |
template<class Tgt , class Src > | |
std::enable_if< std::is_integral< Src >::value &&!std::is_same< Tgt, Src >::value &&!std::is_same< Tgt, bool >::value &&std::is_integral< Tgt >::value, Expected< Tgt, ConversionCode > >::type | convertTo (const Src &value) noexcept |
template<class Tgt , class Src > | |
std::enable_if< std::is_floating_point< Tgt >::value &&std::is_floating_point< Src >::value &&!std::is_same< Tgt, Src >::value, Expected< Tgt, ConversionCode > >::type | convertTo (const Src &value) noexcept |
template<typename Tgt , typename Src > | |
std::enable_if< std::is_floating_point< Src >::value &&std::is_integral< Tgt >::value &&!std::is_same< Tgt, bool >::value, bool >::type | checkConversion (const Src &value) |
template<typename Tgt , typename Src > | |
constexpr std::enable_if< std::is_integral< Src >::value &&std::is_floating_point< Tgt >::value, bool >::type | checkConversion (const Src &) |
template<typename Tgt , typename Src > | |
constexpr std::enable_if< std::is_floating_point< Src >::value &&std::is_same< Tgt, bool >::value, bool >::type | checkConversion (const Src &) |
template<typename Tgt , typename Src > | |
std::enable_if< (std::is_integral< Src >::value &&std::is_floating_point< Tgt >::value)||(std::is_floating_point< Src >::value &&std::is_integral< Tgt >::value), Expected< Tgt, ConversionCode > >::type | convertTo (const Src &value) noexcept |
template<typename Tgt , typename Src > | |
std::string | errorValue (const Src &value) |
template<class Tgt > | |
std::enable_if< std::is_void< ParseToResult< Tgt > >::value, Expected< StringPiece, ConversionCode > >::type | parseToWrap (StringPiece sp, Tgt &out) |
template<class Tgt > | |
std::enable_if< !std::is_void< ParseToResult< Tgt > >::value, ParseToResult< Tgt > >::type | parseToWrap (StringPiece sp, Tgt &out) |
template<typename Cond > | |
void | atomic_hash_spin_wait (Cond condition) |
int | cplus_demangle_v3_callback_wrapper (char const *const mangled, void(*const cbref)(char const *, std::size_t, void *), void *const opaque) |
template<typename TargetClock , typename Clock , typename Duration > | |
TargetClock::time_point | time_point_conv (std::chrono::time_point< Clock, Duration > const &time) |
int | futexWakeImpl (const Futex< std::atomic > *futex, int count, uint32_t wakeMask) |
FutexResult | futexWaitImpl (const Futex< std::atomic > *futex, uint32_t expected, std::chrono::system_clock::time_point const *absSystemTime, std::chrono::steady_clock::time_point const *absSteadyTime, uint32_t waitMask) |
int | futexWakeImpl (const Futex< EmulatedFutexAtomic > *futex, int count, uint32_t wakeMask) |
FutexResult | futexWaitImpl (const Futex< EmulatedFutexAtomic > *futex, uint32_t expected, std::chrono::system_clock::time_point const *absSystemTime, std::chrono::steady_clock::time_point const *absSteadyTime, uint32_t waitMask) |
template<typename Futex , typename Deadline > | |
std::enable_if< Deadline::clock::is_steady, FutexResult >::type | futexWaitImpl (Futex *futex, uint32_t expected, Deadline const &deadline, uint32_t waitMask) |
template<typename Futex , typename Deadline > | |
std::enable_if<!Deadline::clock::is_steady, FutexResult >::type | futexWaitImpl (Futex *futex, uint32_t expected, Deadline const &deadline, uint32_t waitMask) |
template<typename Futex > | |
FutexResult | futexWait (const Futex *futex, uint32_t expected, uint32_t waitMask) |
template<typename Futex > | |
int | futexWake (const Futex *futex, int count, uint32_t wakeMask) |
template<typename Futex , class Clock , class Duration > | |
FutexResult | futexWaitUntil (const Futex *futex, uint32_t expected, std::chrono::time_point< Clock, Duration > const &deadline, uint32_t waitMask) |
FutexResult | futexWaitImpl (const Futex< std::atomic > *futex, uint32_t expected, system_clock::time_point const *absSystemTime, steady_clock::time_point const *absSteadyTime, uint32_t waitMask) |
FutexResult | futexWaitImpl (const Futex< EmulatedFutexAtomic > *futex, uint32_t expected, system_clock::time_point const *absSystemTime, steady_clock::time_point const *absSteadyTime, uint32_t waitMask) |
std::string | familyNameStrDefault (sa_family_t family) |
void | getNthMSBitImplThrow (size_t bitCount, sa_family_t family) |
std::string | familyNameStr (sa_family_t family) |
template<typename IPAddrType > | |
bool | getNthMSBitImpl (const IPAddrType &ip, size_t bitIndex, sa_family_t family) |
template<class IntegralType , IntegralType DigitCount, IntegralType Base = IntegralType(10), bool PrintAllDigits = false, class = typename std::enable_if< std::is_integral<IntegralType>::value && std::is_unsigned<IntegralType>::value, bool>::type> | |
void | writeIntegerString (IntegralType val, char **buffer) |
size_t | fastIpV4ToBufferUnsafe (const in_addr &inAddr, char *str) |
std::string | fastIpv4ToString (const in_addr &inAddr) |
void | fastIpv4AppendToString (const in_addr &inAddr, std::string &out) |
size_t | fastIpv6ToBufferUnsafe (const in6_addr &in6Addr, char *str) |
std::string | fastIpv6ToString (const in6_addr &in6Addr) |
void | fastIpv6AppendToString (const in6_addr &in6Addr, std::string &out) |
size_t | qfind_first_byte_of_bitset (const StringPieceLite haystack, const StringPieceLite needles) |
size_t | qfind_first_byte_of_byteset (const StringPieceLite haystack, const StringPieceLite needles) |
size_t | qfind_first_byte_of_std (const StringPieceLite haystack, const StringPieceLite needles) |
size_t | qfind_first_byte_of_nosse (const StringPieceLite haystack, const StringPieceLite needles) |
size_t | qfind_first_byte_of_sse42 (const StringPieceLite haystack, const StringPieceLite needles) |
ssize_t | tfo_sendmsg (int, const struct msghdr *, int) |
int | tfo_enable (int, size_t) |
bool | tfo_succeeded (int) |
template<typename T , typename Tag , typename F > | |
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T * | createGlobal (F &&creator) |
template<typename T , typename Tag > | |
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T * | createGlobal () |
TEST_F (StaticSingletonManagerTest, example) | |
template<template< class > class Op> | |
dynamic | numericOp (dynamic const &a, dynamic const &b) |
template<typename F > | |
exception_wrapper | try_and_catch_ (F &&f) |
template<typename F , typename Ex , typename... Exs> | |
exception_wrapper | try_and_catch_ (F &&f) |
template<typename Fn > | |
EnableForArgTypes< Fn > | invokeForKeyValue (Fn f, const folly::dynamic &, const folly::dynamic &) |
template<typename Fn > | |
EnableForArgTypes< Fn, folly::dynamic > | invokeForKeyValue (Fn fn, const folly::dynamic &, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, int64_t > | invokeForKeyValue (Fn fn, const folly::dynamic &, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, bool > | invokeForKeyValue (Fn fn, const folly::dynamic &, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, double > | invokeForKeyValue (Fn fn, const folly::dynamic &, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, std::string > | invokeForKeyValue (Fn fn, const folly::dynamic &, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, folly::dynamic, folly::dynamic > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, folly::dynamic, int64_t > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, folly::dynamic, bool > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, folly::dynamic, double > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, folly::dynamic, std::string > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, std::string, folly::dynamic > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, std::string, int64_t > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, std::string, bool > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, std::string, double > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, std::string, std::string > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, int64_t, folly::dynamic > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, int64_t, int64_t > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, int64_t, bool > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, int64_t, double > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
template<typename Fn > | |
EnableForArgTypes< Fn, int64_t, std::string > | invokeForKeyValue (Fn fn, const folly::dynamic &k, const folly::dynamic &v) |
std::string | toPseudoJson (const folly::dynamic &d) |
constexpr size_t | poly_size (size_t bits) |
void | insertThousandsGroupingUnsafe (char *start_buffer, char **end_buffer) |
template<class Uint > | |
size_t | uintToHex (char *buffer, size_t bufLen, Uint v, std::array< std::array< char, 2 >, 256 > const &repr) |
template<class Uint > | |
size_t | uintToHexLower (char *buffer, size_t bufLen, Uint v) |
template<class Uint > | |
size_t | uintToHexUpper (char *buffer, size_t bufLen, Uint v) |
template<class Uint > | |
size_t | uintToOctal (char *buffer, size_t bufLen, Uint v) |
template<class Uint > | |
size_t | uintToBinary (char *buffer, size_t bufLen, Uint v) |
std::shared_ptr< Timekeeper > | getTimekeeperSingleton () |
uint32_t | crc32c_sw (const uint8_t *data, size_t nbytes, uint32_t startingChecksum) |
uint32_t | crc32_hw (const uint8_t *, size_t, uint32_t) |
bool | crc32c_hw_supported () |
bool | crc32_hw_supported () |
template<uint32_t CRC_POLYNOMIAL> | |
uint32_t | crc_sw (const uint8_t *data, size_t nbytes, uint32_t startingChecksum) |
uint32_t | crc32_sw (const uint8_t *data, size_t nbytes, uint32_t startingChecksum) |
uint32_t | crc32c_hw (const uint8_t *data, size_t nbytes, uint32_t startingChecksum=~0U) |
uint32_t | crc32_combine_sw (uint32_t crc1, uint32_t crc2, size_t crc2len) |
uint32_t | crc32_combine_hw (uint32_t crc1, uint32_t crc2, size_t crc2len) |
uint32_t | crc32c_combine_sw (uint32_t crc1, uint32_t crc2, size_t crc2len) |
uint32_t | crc32c_combine_hw (uint32_t crc1, uint32_t crc2, size_t crc2len) |
constexpr size_t | max_align_ (std::size_t a) |
template<typename... Es> | |
constexpr std::size_t | max_align_ (std::size_t a, std::size_t e, Es...es) |
void | assume_check (bool cond) |
template<typename Dst , typename Src > | |
constexpr std::make_signed_t< Dst > | bits_to_signed (Src const s) |
template<typename Dst , typename Src > | |
constexpr std::make_unsigned_t< Dst > | bits_to_unsigned (Src const s) |
static uint8_t | byteswap_gen (uint8_t v) |
static uint64_t | byteswap_gen (uint64_t v) |
static uint32_t | byteswap_gen (uint32_t v) |
static uint16_t | byteswap_gen (uint16_t v) |
template<typename T > | |
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T && | to_exception_arg_ (T &&t) |
template<std::size_t N> | |
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN char const * | to_exception_arg_ (char const (&array)[N]) |
template<typename Ex , typename... Args> | |
FOLLY_NOINLINE FOLLY_COLD void | throw_exception_ (Args &&...args) |
template<typename Ex , typename... Args> | |
FOLLY_NOINLINE FOLLY_COLD void | terminate_with_ (Args &&...args) noexcept |
void | assertionFailure (const char *expr, const char *msg, const char *file, unsigned int line, const char *function) |
template<typename Arg > | |
auto | fallbackFormatOneArg (std::string *str, const Arg *arg, int) -> decltype(toAppend(std::declval< Arg >(), std::declval< std::string * >()), std::declval< void >()) |
template<typename Arg > | |
void | fallbackFormatOneArg (std::string *str, const Arg *arg, long) |
constexpr const char * | xlogStripFilenameRecursive (const char *filename, const char *prefixes, size_t prefixIdx, size_t filenameIdx, bool match) |
constexpr const char * | xlogStripFilenameMatchFound (const char *filename, const char *prefixes, size_t prefixIdx, size_t filenameIdx) |
template<class... KeysDefault> | |
auto | extract_default (const KeysDefault &...keysDefault) -> typename DefaultType< KeysDefault... >::type const & |
template<typename T > | |
constexpr T | divFloorBranchless (T num, T denom) |
template<typename T > | |
constexpr T | divFloorBranchful (T num, T denom) |
template<typename T > | |
constexpr T | divCeilBranchless (T num, T denom) |
template<typename T > | |
constexpr T | divCeilBranchful (T num, T denom) |
template<typename T > | |
constexpr T | divRoundAwayBranchless (T num, T denom) |
template<typename T > | |
constexpr T | divRoundAwayBranchful (T num, T denom) |
void | handleMallctlError (const char *cmd, int err) |
template<typename T > | |
void | mallctlHelper (const char *cmd, T *out, T *in) |
void | unsafeStringSetLargerSize (std::string &s, std::size_t n) |
template<typename T > | |
void | unsafeVectorSetLargerSize (std::vector< T > &v, std::size_t n) |
template<typename Alloc , size_t kAlign, bool kAllocate> | |
void | rawOverAlignedImpl (Alloc const &alloc, size_t n, void *&raw) |
FOLLY_CREATE_MEMBER_INVOKE_TRAITS (AllocatorConstruct_, construct) | |
FOLLY_CREATE_MEMBER_INVOKE_TRAITS (AllocatorDestroy_, destroy) | |
template<typename Char > | |
constexpr size_t | constexpr_strlen_internal (const Char *s, size_t len) |
template<typename Char > | |
constexpr int | constexpr_strcmp_internal (const Char *s1, const Char *s2) |
bool | sysMembarrierAvailable () |
int | sysMembarrier () |
template<class Iter > | |
std::enable_if< std::is_same< typename std::iterator_traits< Iter >::iterator_category, std::random_access_iterator_tag >::value, typename std::iterator_traits< Iter >::reference >::type | value_before (Iter i) |
template<class Iter > | |
std::enable_if< !std::is_same< typename std::iterator_traits< Iter >::iterator_category, std::random_access_iterator_tag >::value, typename std::iterator_traits< Iter >::reference >::type | value_before (Iter i) |
size_t | qfind_first_byte_of (const StringPiece haystack, const StringPiece needles) |
template<typename FunctionType > | |
ScopeGuardImpl< typename std::decay< FunctionType >::type, true > | operator+ (detail::ScopeGuardOnExit, FunctionType &&fn) |
std::unique_lock< std::mutex > | sharedMutexAnnotationGuard (void *ptr) |
void | singletonWarnDoubleRegistrationAndAbort (const TypeDescriptor &type) |
static void | singleton_hs_init_weak (int *argc, char **argv[]) __attribute__((__weakref__("hs_init"))) |
void | singletonWarnLeakyDoubleRegistrationAndAbort (const TypeDescriptor &type) |
void | singletonWarnLeakyInstantiatingNotRegisteredAndAbort (const TypeDescriptor &type) |
void | singletonWarnRegisterMockEarlyAndAbort (const TypeDescriptor &type) |
void | singletonWarnDestroyInstanceLeak (const TypeDescriptor &type, const void *ptr) |
void | singletonWarnCreateCircularDependencyAndAbort (const TypeDescriptor &type) |
void | singletonWarnCreateUnregisteredAndAbort (const TypeDescriptor &type) |
void | singletonWarnCreateBeforeRegistrationCompleteAndAbort (const TypeDescriptor &type) |
void | singletonPrintDestructionStackTrace (const TypeDescriptor &type) |
void | singletonThrowNullCreator (const std::type_info &type) |
void | singletonThrowGetInvokedAfterDestruction (const TypeDescriptor &type) |
template<class T > | |
std::enable_if< std::is_default_constructible< T >::value &&!folly::is_trivially_copyable< T >::value >::type | moveObjectsRight (T *first, T *lastConstructed, T *realLast) |
template<class T > | |
std::enable_if< !std::is_default_constructible< T >::value||folly::is_trivially_copyable< T >::value >::type | moveObjectsRight (T *first, T *lastConstructed, T *realLast) |
template<class T , class Function > | |
void | populateMemForward (T *mem, std::size_t n, Function const &op) |
template<class T > | |
T * | pointerFlagSet (T *p) |
template<class T > | |
bool | pointerFlagGet (T *p) |
template<class T > | |
T * | pointerFlagClear (T *p) |
void * | shiftPointer (void *p, size_t sizeBytes) |
template<class Iterator > | |
int | distance_if_multipass (Iterator first, Iterator last) |
template<class OurContainer , class Vector , class GrowthPolicy > | |
OurContainer::iterator | insert_with_hint (OurContainer &sorted, Vector &cont, typename OurContainer::iterator hint, typename OurContainer::value_type &&value, GrowthPolicy &po) |
template<class OurContainer , class Vector , class InputIterator > | |
void | bulk_insert (OurContainer &sorted, Vector &cont, InputIterator first, InputIterator last) |
template<typename Container , typename Compare > | |
Container && | as_sorted (Container &&container, Compare const &comp) |
template<typename ReturnType > | |
ReturnType | avgHelper (long double sum, uint64_t count) |
template<typename ReturnType , typename ValueType > | |
std::enable_if< !std::is_same< typename std::remove_cv< ValueType >::type, long double >::value, ReturnType >::type | avgHelper (ValueType sum, uint64_t count) |
template<typename ReturnType = double, typename Duration = std::chrono::seconds, typename Interval = Duration> | |
ReturnType | rateHelper (ReturnType count, Duration elapsed) |
static uint8_t | getRadixBucket (double *f, uint8_t shift) |
static void | double_radix_sort_rec (uint64_t n, uint64_t *buckets, uint8_t shift, bool inout, double *in, double *out) |
void | double_radix_sort (uint64_t n, uint64_t *buckets, double *in, double *tmp) |
QuantileEstimates | estimatesFromDigest (const TDigest &digest, Range< const double * > quantiles) |
size_t | delimSize (char) |
size_t | delimSize (StringPiece s) |
bool | atDelim (const char *s, char c) |
bool | atDelim (const char *s, StringPiece sp) |
char | delimFront (char c) |
char | delimFront (StringPiece s) |
template<class OutStringT , class DelimT , class OutputIterator > | |
void | internalSplit (DelimT delim, StringPiece sp, OutputIterator out, bool ignoreEmpty) |
template<class String > | |
StringPiece | prepareDelim (const String &s) |
char | prepareDelim (char c) |
template<class OutputType > | |
void | toOrIgnore (StringPiece input, OutputType &output) |
void | toOrIgnore (StringPiece, decltype(std::ignore)&) |
template<bool exact, class Delim , class OutputType > | |
bool | splitFixed (const Delim &delimiter, StringPiece input, OutputType &output) |
template<bool exact, class Delim , class OutputType , class... OutputTypes> | |
bool | splitFixed (const Delim &delimiter, StringPiece input, OutputType &outHead, OutputTypes &...outTail) |
template<class Delim , class Iterator , class String > | |
void | internalJoinAppend (Delim delimiter, Iterator begin, Iterator end, String &output) |
template<class Delim , class Iterator , class String > | |
std::enable_if< IsSizableStringContainerIterator< Iterator >::value >::type | internalJoin (Delim delimiter, Iterator begin, Iterator end, String &output) |
template<class Delim , class Iterator , class String > | |
std::enable_if< !IsSizableStringContainerIterator< Iterator >::value >::type | internalJoin (Delim delimiter, Iterator begin, Iterator end, String &output) |
size_t | hexDumpLine (const void *ptr, size_t offset, size_t size, std::string &line) |
template<typename Atomic > | |
bool | atomic_fetch_set_default (Atomic &atomic, std::size_t bit, std::memory_order order) |
template<typename Atomic > | |
bool | atomic_fetch_reset_default (Atomic &atomic, std::size_t bit, std::memory_order order) |
template<typename Atomic > | |
bool | atomic_fetch_set_x86 (Atomic &, std::size_t, std::memory_order) noexcept |
template<typename Atomic > | |
bool | atomic_fetch_reset_x86 (Atomic &, std::size_t, std::memory_order) noexcept |
std::memory_order | default_failure_memory_order (std::memory_order successMode) |
template<typename Clock , typename Duration , typename F > | |
spin_result | spin_pause_until (std::chrono::time_point< Clock, Duration > const &deadline, WaitOptions const &opt, F f) |
template<typename Clock , typename Duration , typename F > | |
spin_result | spin_yield_until (std::chrono::time_point< Clock, Duration > const &deadline, F f) |
constexpr int | hazptr_domain_rcount_threshold () |
void | annotate_rwlock_create_impl (void const volatile *const addr, char const *const f, int const l) |
void | annotate_rwlock_create_static_impl (void const volatile *const addr, char const *const f, int const l) |
void | annotate_rwlock_destroy_impl (void const volatile *const addr, char const *const f, int const l) |
void | annotate_rwlock_acquired_impl (void const volatile *const addr, annotate_rwlock_level const w, char const *const f, int const l) |
void | annotate_rwlock_try_acquired_impl (void const volatile *const addr, annotate_rwlock_level const w, bool const result, char const *const f, int const l) |
void | annotate_rwlock_released_impl (void const volatile *const addr, annotate_rwlock_level const w, char const *const f, int const l) |
void | annotate_benign_race_sized_impl (const volatile void *addr, long size, const char *desc, const char *f, int l) |
template<typename Synchronized , typename LockFunc , typename TryLockFunc , typename... Args> | |
auto | makeSynchronizedLocker (Synchronized &synchronized, LockFunc &&lockFunc, TryLockFunc &&tryLockFunc, Args &&...args) |
template<typename... SynchronizedLocker> | |
auto | lock (SynchronizedLocker...lockersIn) -> std::tuple< typename SynchronizedLocker::LockedPtr... > |
template<typename Synchronized , typename... Args> | |
auto | wlock (Synchronized &synchronized, Args &&...args) |
template<typename Synchronized , typename... Args> | |
auto | rlock (Synchronized &synchronized, Args &&...args) |
template<typename Synchronized , typename... Args> | |
auto | ulock (Synchronized &synchronized, Args &&...args) |
template<typename Synchronized , typename... Args> | |
auto | lock (Synchronized &synchronized, Args &&...args) |
template<typename... Arguments> | |
std::vector< std::string > | shellify (StringPiece format, Arguments &&...arguments) |
FOLLY_PUSH_WARNING | FOLLY_MSVC_DISABLE_WARNING (4388) FOLLY_MSVC_DISABLE_WARNING(4804) template< typename RHS |
FOLLY_PUSH_WARNING RHS LHS bool | less_than_impl (LHS const lhs) |
template<typename RHS , RHS rhs, typename LHS > | |
bool | greater_than_impl (LHS const lhs) |
Variables | |
constexpr double | kClampCastLowerBoundDoubleToInt64F = -9223372036854774784.0 |
constexpr double | kClampCastUpperBoundDoubleToInt64F = 9223372036854774784.0 |
constexpr double | kClampCastUpperBoundDoubleToUInt64F = 18446744073709549568.0 |
constexpr float | kClampCastLowerBoundFloatToInt32F = -2147483520.0f |
constexpr float | kClampCastUpperBoundFloatToInt32F = 2147483520.0f |
constexpr float | kClampCastUpperBoundFloatToUInt32F = 4294967040.0f |
struct folly::detail::LastElementImpl | sizeof |
FOLLY_STORAGE_CONSTEXPR std::array< std::array< std::uint8_t, 256 >, 8 > const | kSelectInByte |
const std::array< std::array< char, 2 >, 256 > | formatHexUpper |
const std::array< std::array< char, 2 >, 256 > | formatHexLower |
const std::array< std::array< char, 3 >, 512 > | formatOctal |
const std::array< std::array< char, 8 >, 256 > | formatBinary |
const size_t | kMaxHexLength = 2 * sizeof(uintmax_t) |
const size_t | kMaxOctalLength = 3 * sizeof(uintmax_t) |
const size_t | kMaxBinaryLength = 8 * sizeof(uintmax_t) |
FOLLY_STORAGE_CONSTEXPR auto | formatAlignTable |
FOLLY_STORAGE_CONSTEXPR auto | formatSignTable |
static FOLLY_TLS uint32_t | tls_lastCpuBufferSlot = 0 |
const std::array< char, 256 > | cEscapeTable |
const std::array< char, 256 > | cUnescapeTable |
const std::array< unsigned char, 256 > | hexTable |
const std::array< unsigned char, 256 > | uriEscapeTable |
template<typename T > | |
constexpr auto | is_atomic = false |
FOLLY_PUSH_WARNING RHS | rhs |
Call doNotOptimizeAway(var) to ensure that var will be computed even post-optimization. Use it for variables that are computed during benchmarking but otherwise are useless. The compiler tends to do a good job at eliminating unused variables, and this function fools it into thinking var is in fact needed.
Call makeUnpredictable(var) when you don't want the optimizer to use its knowledge of var to shape the following code. This is useful when constant propagation or power reduction is possible during your benchmark but not in real use cases.
DynamicParser provides a tiny DSL for easily, correctly, and losslessly parsing a folly::dynamic into any other representation.
To make this concrete, this lets you take a JSON config that potentially contains user errors, and parse all of its valid parts, while automatically and reversibly recording any parts that cause errors:
{"my values": { "an int": "THIS WILL BE RECORDED AS AN ERROR, BUT WE'LL PARSE THE REST", "a double": 3.1415, "keys & values": { "the sky is blue": true, "THIS WILL ALSO BE RECORDED AS AN ERROR": "cheese", "2+2=5": false, } }}
To parse this JSON, you need no exception handling, it is as easy as:
folly::dynamic d = ...; // Input int64_t integer; // Three outputs double real; std::map<std::string, bool> enabled_widgets; DynamicParser p(DynamicParser::OnError::RECORD, &d); p.required("my values", [&]() { p.optional("an int", [&](int64_t v) { integer = v; }); p.required("a double", [&](double v) { real = v; }); p.optional("keys & values", [&]() { p.objectItems([&](std::string widget, bool enabled) { enabled_widgets.emplace(widget, enabled); }); }); });
Your code in the lambdas can throw, and this will be reported just like missing key and type conversion errors, with precise context on what part of the folly::dynamic caused the error. No need to throw: std::runtime_error("Value X at key Y caused a flux capacitor overload") This will do: std::runtime_error("Flux capacitor overload")
== Keys and values are auto-converted to match your callback ==
DynamicParser's optional(), required(), objectItems(), and arrayItems() automatically convert the current key and value to match the signature of the provided callback. parser.key() and parser.value() can be used to access the same data without conversion.
The following types are supported – you should generally take arguments by-value, or by-const-reference for dynamics & strings you do not copy.
Key: folly::dynamic (no conversion), std::string, int64_t Value: folly::dynamic (no conversion), int64_t, bool, double, std::string
There are 21 supported callback signatures, of three kinds:
1: No arguments – useful if you will just call more parser methods.
5: The value alone – the common case for optional() and required(). [&](whatever_t value) {}
15: Both the key and the value converted according to the rules above: [&](whatever_t key, whatever_t) {}
NB: The key alone should be rarely needed, but these callback styles provide it with no conversion overhead, and only minimal verbosity: [&](const std::string& k, const folly::dynamic&) {} [&]() { auto k = p.key().asString(); }
== How releaseErrors()
can make your parse lossless ==
If you write parsing code by hand, you usually end up with error-handling resembling that of OnError::THROW – the first error you hit aborts the whole parse, and you report it.
OnError::RECORD offers a more user-friendly alternative for "parse, serialize, re-parse" pipelines, akin to what web-forms do. All exception-causing parts are losslessly recorded in a parallel folly::dynamic, available via releaseErrors() at the end of the parse.
Suppose we fail to look up "key1" at the root, and hit a value error in "key2": {"subkey2": ...}. The error report will have the form:
{"nested": { "key_errors": {"key1": "explanatory message"}, "value": <whole input>="">, "nested": { "key2": { "nested": { "subkey2": {"value": <original value>="">, "error": "message"} } } } }}
Errors in array items are handled just the same, but using integer keys.
The advantage of this approach is that your parsing can throw wherever, and DynamicParser isolates it, allowing the good parts to parse.
Put another way, this makes it easy to implement a transformation that splits a folly::dynamic
into a "parsed" part (which might be your struct meant for runtime use), and a matching "errors" part. As long as your successful parses are lossless, you can always reconstruct the original input from the parse output and the recorded "errors".
== Limitations ==
== Future: un-parsed items ==
DynamicParser could support erroring on un-parsed items – the parts of the folly::dynamic, which were never asked for. Here is an ok design:
(i) At the start of parsing any value, the user may call: parser.recursivelyForbidUnparsed(); parser.recursivelyAllowUnparsed(); parser.locallyForbidUnparsed(); parser.locallyAllowUnparsed();
(ii) At the end of the parse, any unparsed items are dumped to "errors". For example, failing to parse index 1 out of ["v1", "v2", "v3"] yields: "nested": {1: {"unparsed": "v2"}} or perhaps more verbosely: "nested": {1: {"error": "unparsed value", "value": "v2"}}
By default, unparsed items are allowed. Calling a "forbid" function after some keys have already been parsed is allowed to fail (this permits a lazy implementation, which has minimal overhead when "forbid" is not requested).
== Future: multiple value errors ==
The present contract is that exactly one value error is reported per location in the input (multiple key lookup errors are, of course, supported). If the need arises, multiple value errors could easily be supported by replacing the "error" string with an "errors" array.
Wrap a sequence or associative container so that out-of-range lookups return a default value rather than throwing an exception.
Usage: format("[no_such_key"], defaulted(map, 42)) -> 42
Creates a NotificationQueue::Consumer wrapping a function object Modeled after AsyncTimeout::make
An IOBuf is a pointer to a buffer of data.
IOBuf objects are intended to be used primarily for networking code, and are modelled somewhat after FreeBSD's mbuf data structure, and Linux's sk_buff structure.
IOBuf objects facilitate zero-copy network programming, by allowing multiple IOBuf objects to point to the same underlying buffer of data, using a reference count to track when the buffer is no longer needed and can be freed.
The IOBuf itself is a small object containing a pointer to the buffer and information about which segment of the buffer contains valid data.
The data layout looks like this:
+----—+ | IOBuf | +----—+ / | v +---------—+-----------------—+--------—+ | headroom | data | tailroom | +---------—+-----------------—+--------—+ ^ ^ ^ ^ buffer() data() tail() bufferEnd()
The length() method returns the length of the valid data; capacity() returns the entire capacity of the buffer (from buffer() to bufferEnd()). The headroom() and tailroom() methods return the amount of unused capacity available before and after the data.
The buffer itself is reference counted, and multiple IOBuf objects may point to the same buffer. Each IOBuf may point to a different section of valid data within the underlying buffer. For example, if multiple protocol requests are read from the network into a single buffer, a separate IOBuf may be created for each request, all sharing the same underlying buffer.
In other words, when multiple IOBufs share the same underlying buffer, the data() and tail() methods on each IOBuf may point to a different segment of the data. However, the buffer() and bufferEnd() methods will point to the same location for all IOBufs sharing the same underlying buffer.
+-----------+ +---------+ | IOBuf 1 | | IOBuf 2 | +-----------+ +---------+ | | _____/ |
data | tail |/ data | tail v v v +----------------------------------—+ | | | | | +----------------------------------—+
If you only read data from an IOBuf, you don't need to worry about other IOBuf objects possibly sharing the same underlying buffer. However, if you ever write to the buffer you need to first ensure that no other IOBufs point to the same buffer. The unshare() method may be used to ensure that you have an unshared buffer.
IOBuf objects also contain pointers to next and previous IOBuf objects. This can be used to represent a single logical piece of data that its stored in non-contiguous chunks in separate buffers.
A single IOBuf object can only belong to one chain at a time.
IOBuf chains are always circular. The "prev" pointer in the head of the chain points to the tail of the chain. However, it is up to the user to decide which IOBuf is the head. Internally the IOBuf code does not care which element is the head.
The lifetime of all IOBufs in the chain are linked: when one element in the chain is deleted, all other chained elements are also deleted. Conceptually it is simplest to treat this as if the head of the chain owns all other IOBufs in the chain. When you delete the head of the chain, it will delete the other elements as well. For this reason, prependChain() and appendChain() take ownership of of the new elements being added to this chain.
When the coalesce() method is used to coalesce an entire IOBuf chain into a single IOBuf, all other IOBufs in the chain are eliminated and automatically deleted. The unshare() method may coalesce the chain; if it does it will similarly delete all IOBufs eliminated from the chain.
As discussed in the following section, it is up to the user to maintain a lock around the entire IOBuf chain if multiple threads need to access the chain. IOBuf does not provide any internal locking.
When used in multithread programs, a single IOBuf object should only be used in a single thread at a time. If a caller uses a single IOBuf across multiple threads the caller is responsible for using an external lock to synchronize access to the IOBuf.
Two separate IOBuf objects may be accessed concurrently in separate threads without locking, even if they point to the same underlying buffer. The buffer reference count is always accessed atomically, and no other operations should affect other IOBufs that point to the same data segment. The caller is responsible for using unshare() to ensure that the data buffer is not shared by other IOBufs before writing to it, and this ensures that the data itself is not modified in one thread while also being accessed from another thread.
For IOBuf chains, no two IOBufs in the same chain should be accessed simultaneously in separate threads. The caller must maintain a lock around the entire chain if the chain, or individual IOBufs in the chain, may be accessed by multiple threads.
IOBuf objects themselves exist separately from the data buffer they point to. Therefore one must also consider how to allocate and manage the IOBuf objects.
It is more common to allocate IOBuf objects on the heap, using the create(), takeOwnership(), or wrapBuffer() factory functions. The clone()/cloneOne() functions also return new heap-allocated IOBufs. The createCombined() function allocates the IOBuf object and data storage space together, in a single memory allocation. This can improve performance, particularly if you know that the data buffer and the IOBuf itself will have similar lifetimes.
That said, it is also possible to allocate IOBufs on the stack or inline inside another object as well. This is useful for cases where the IOBuf is short-lived, or when the overhead of allocating the IOBuf on the heap is undesirable.
However, note that stack-allocated IOBufs may only be used as the head of a chain (or standalone as the only IOBuf in a chain). All non-head members of an IOBuf chain must be heap allocated. (All functions to add nodes to a chain require a std::unique_ptr<IOBuf>, which enforces this requrement.)
Copying IOBufs is only meaningful for the head of a chain. The entire chain is cloned; the IOBufs will become shared, and the old and new IOBufs will refer to the same underlying memory.
The IOBuf class manages sharing of the underlying buffer that it points to, maintaining a reference count if multiple IOBufs are pointing at the same buffer.
However, it is the callers responsibility to manage sharing and ownership of IOBuf objects themselves. The IOBuf structure does not provide room for an intrusive refcount on the IOBuf object itself, only the underlying data buffer is reference counted. If users want to share the same IOBuf object between multiple parts of the code, they are responsible for managing this sharing on their own. (For example, by using a shared_ptr. Alternatively, users always have the option of using clone() to create a second IOBuf that points to the same underlying buffer.)
Endianness detection and manipulation primitives.
Small internal helper - returns the value just before an iterator.
Specializations of comparison operators for StringPiece
using folly::detail::ArgumentTypes = typedef typename ArgumentTypesByKind<IdentifyCallable::getKind<Fn>(), Fn>::type |
Definition at line 80 of file DynamicParser-inl.h.
using folly::detail::AsTypeList = typedef _t<impl::AsTypeList_<T>> |
Convert a type to a list of types. Given a type T
:
T
is of the form C<Ts...>
, where C
is a class template and Ts...
is a list of types, the result is TypeList<Ts...>
.T
is of the form std::integer_sequence<T, Is...>
, then the result is TypeList<std::integral_constant<T, Is>...>
.asTypeList<T>
is ill-formed. Definition at line 514 of file TypeList.h.
using folly::detail::BenchmarkFun = typedef std::function<detail::TimeIterPair(unsigned int)> |
Definition at line 59 of file Benchmark.h.
using folly::detail::Bool = typedef bool_constant<B> |
Handy shortcuts for some standard facilities
Definition at line 81 of file TypeList.h.
using folly::detail::EnableForArgTypes = typedef typename std::enable_if<HasArgumentTypes<Args...>::value, void>::type |
Definition at line 97 of file DynamicParser-inl.h.
using folly::detail::False = typedef std::false_type |
Definition at line 83 of file TypeList.h.
using folly::detail::Futex = typedef Atom<std::uint32_t> |
Futex is an atomic 32 bit unsigned integer that provides access to the futex() syscall on that value. It is templated in such a way that it can interact properly with DeterministicSchedule testing.
If you don't know how to use futex(), you probably shouldn't be using this class. Even if you do know how, you should have a good reason (and benchmarks to back you up).
Because of the semantics of the futex syscall, the futex family of functions are available as free functions rather than member functions
using folly::detail::If = typedef MetaApply<impl::If_<If_>, Then, Else> |
Like std::conditional, but with fewer template instantiations
Definition at line 159 of file TypeList.h.
using folly::detail::Inherit = typedef impl::Inherit_<List> |
Given a TypeList
, create a type that inherits from all the types in the list.
Requires: all of the types in the list are non-final class types, and the types are all unique.
Definition at line 438 of file TypeList.h.
using folly::detail::IntermediateDuration = typedef std::chrono::duration< typename IntermediateTimeRep< Rep, std::is_floating_point<Rep>::value, std::is_signed<Rep>::value>::type, std::ratio<1, Period::den>> |
using folly::detail::is_decay_propagate_const = typedef is_propagate_const<_t<std::decay<T>>> |
Definition at line 47 of file PropagateConst.h.
using folly::detail::IsArithToArith = typedef bool_constant< !std::is_same<Tgt, Src>::value && !std::is_same<Tgt, bool>::value && std::is_arithmetic<Src>::value && std::is_arithmetic<Tgt>::value> |
using folly::detail::LockedPtrType = typedef typename std::conditional< std::is_const<SynchronizedType>::value, typename SynchronizedType::ConstLockedPtr, typename SynchronizedType::LockedPtr>::type |
Definition at line 795 of file Synchronized.h.
using folly::detail::max_align_v_ = typedef max_align_t_< long double, double, float, long long int, long int, int, short int, bool, char, char16_t, char32_t, wchar_t, void*, std::max_align_t> |
using folly::detail::MetaApply = typedef typename Fn::template apply<Ts...> |
Given a metafunction class Fn
and arguments Ts...
, invoke Fn
with Ts...
.
Definition at line 90 of file TypeList.h.
using folly::detail::MetaCurry = typedef MetaCompose<Fn, MetaQuote<TypeList>> |
Given a metafunction class Fn
that expects a single TypeList
argument, turn it into a metafunction class that takes N
arguments, wraps them in a TypeList
, and calls Fn
with it.
MetaApply<MetaCurry<Fn>, Ts...>
is equivalent to MetaApply<Fn, TypeList<Ts...>>
.
Definition at line 269 of file TypeList.h.
using folly::detail::MetaQuoteTrait = typedef MetaCompose<MetaQuote<_t>, MetaQuote<C>> |
Lifts a trait class template to be a metafunction class.
MetaApply<MetaQuoteTrait<C>, Ts...>
is equivalent to typename C<Ts...>type
.
Definition at line 232 of file TypeList.h.
using folly::detail::MetaUncurry = typedef MetaBindBack<MetaQuote<MetaApply>, Fn> |
Given a metafunction class Fn
that expects N
arguments, turn it into a metafunction class that takes a single TypeList
arguments and calls Fn
with the types in the TypeList
.
MetaApply<MetaUncurry<Fn>, TypeList<Ts...>>
is equivalent to MetaApply<Fn, Ts...>
.
Definition at line 280 of file TypeList.h.
using folly::detail::MetaUnpack = typedef MetaApply<List, Fn> |
Given a metafunction class Fn
and a TypeList
, call Fn
with the types in the TypeList
.
Definition at line 308 of file TypeList.h.
using folly::detail::ParseToError = typedef ExpectedErrorType<decltype( detail::parseToWrap(StringPiece{}, std::declval<Tgt&>()))> |
using folly::detail::ParseToResult = typedef decltype(parseTo(StringPiece{}, std::declval<Tgt&>())) |
using folly::detail::poly_table = typedef std::array<std::array<std::array<uint64_t, poly_size(Deg)>, 256>, 8> |
Definition at line 61 of file Fingerprint.h.
using folly::detail::ScopeGuardImplDecay = typedef ScopeGuardImpl<typename std::decay<F>::type, INE> |
Definition at line 138 of file ScopeGuard.h.
using folly::detail::StateSizeT = typedef _t<StateSize<RNG>> |
Definition at line 58 of file Random-inl.h.
using folly::detail::SynchronizedDataType = typedef typename std::conditional< std::is_const<SynchronizedType>::value, typename SynchronizedType::DataType const, typename SynchronizedType::DataType>::type |
Definition at line 786 of file Synchronized.h.
using folly::detail::TimeIterPair = typedef std::pair<std::chrono::high_resolution_clock::duration, unsigned int> |
Definition at line 58 of file Benchmark.h.
using folly::detail::TransparentlyConvertibleToRange = typedef std::is_convertible< T, Range<typename ValueTypeForTransparentConversionToRange<T>::type const*>> |
Definition at line 82 of file HeterogeneousAccess.h.
using folly::detail::True = typedef std::true_type |
Definition at line 82 of file TypeList.h.
using folly::detail::TypeConcat = typedef TypeJoin<TypeList<Ts...>> |
using folly::detail::TypeFold = typedef MetaApply<MetaApply<List, impl::FoldR_<Fn>>, State> |
Given a TypeList
, an initial state, and a binary function, reduce the TypeList
by applying the function to each element and the current state, producing a new state to be used with the next element. This is a "right" fold in functional parlance.
TypeFold<TypeList<A, B, C>, X, Fn>
is equivalent to MetaApply<Fn, A, MetaApply<Fn, B, MetaApply<Fn, C, X>>>
.
Definition at line 380 of file TypeList.h.
using folly::detail::TypePushBack = typedef MetaApply<List, MetaBindBack<MetaQuote<TypeList>, Ts...>> |
using folly::detail::TypePushFront = typedef MetaApply<List, MetaBindFront<MetaQuote<TypeList>, Ts...>> |
using folly::detail::TypeReverseFold = typedef MetaApply<MetaApply<List, impl::FoldL_<Fn>>, State> |
Given a TypeList
, an initial state, and a binary function, reduce the TypeList
by applying the function to each element and the current state, producing a new state to be used with the next element. This is a "left" fold, in functional parlance.
TypeReverseFold<TypeList<A, B, C>, X, Fn>
is equivalent to MetaApply<Fn, MetaApply<Fn, MetaApply<Fn, X, C>, B, A>
.
Definition at line 419 of file TypeList.h.
using folly::detail::TypeReverseUnique = typedef TypeReverseFold<List, TypeList<>, MetaFlip<impl::Unique_>> |
Given a TypeList
, produce a new list of types removing duplicates, keeping the last seen element.
TypeUnique<TypeList<int, short, int>>
is equivalent to TypeList<short, int>
.
Definition at line 488 of file TypeList.h.
using folly::detail::TypeTransform = typedef MetaApply<List, impl::TypeTransform_<Fn>> |
Transform all the elements in a TypeList
with the metafunction class Fn
.
TypeTransform<TypeList<Ts..>, Fn>
is equivalent to TypeList<MetaApply<Fn, Ts>...>
.
Definition at line 327 of file TypeList.h.
using folly::detail::TypeUnique = typedef TypeFold<List, TypeList<>, impl::Unique_> |
Given a TypeList
, produce a new list of types removing duplicates, keeping the first seen element.
TypeUnique<TypeList<int, short, int>>
is equivalent to TypeList<int, short>
.
Definition at line 475 of file TypeList.h.
|
strong |
|
strong |
An enum to describe the "level" of a mutex. The supported levels are Unique - a normal mutex that supports only exclusive locking Shared - a shared mutex which has shared locking and unlocking functions; Upgrade - a mutex that has all the methods of the two above along with support for upgradable locking
Enumerator | |
---|---|
UNIQUE | |
SHARED | |
UPGRADE |
Definition at line 57 of file LockTraits.h.
|
strong |
|
strong |
void folly::detail::addBenchmarkImpl | ( | const char * | file, |
const char * | name, | ||
std::function< TimeIterPair(unsigned int)> | |||
) |
Adds a benchmark wrapped in a std::function. Only used internally. Pass by value is intentional.
Referenced by folly::addBenchmark(), and folly::getGlobalBenchmarkBaselineIndex().
void folly::detail::annotate_benign_race_sized_impl | ( | const volatile void * | addr, |
long | size, | ||
const char * | desc, | ||
const char * | f, | ||
int | l | ||
) |
Definition at line 118 of file SanitizeThread.cpp.
References AnnotateBenignRaceSized(), FOLLY_SANITIZE_THREAD_CALL_HOOK, and folly::kIsSanitizeThread.
Referenced by folly::annotate_benign_race_sized().
void folly::detail::annotate_rwlock_acquired_impl | ( | void const volatile *const | addr, |
annotate_rwlock_level const | w, | ||
char const *const | f, | ||
int const | l | ||
) |
Definition at line 85 of file SanitizeThread.cpp.
References AnnotateRWLockAcquired(), FOLLY_SANITIZE_THREAD_CALL_HOOK, and folly::kIsSanitizeThread.
Referenced by folly::annotate_rwlock_acquired().
void folly::detail::annotate_rwlock_create_impl | ( | void const volatile *const | addr, |
char const *const | f, | ||
int const | l | ||
) |
Definition at line 58 of file SanitizeThread.cpp.
References AnnotateRWLockCreate(), FOLLY_SANITIZE_THREAD_CALL_HOOK, and folly::kIsSanitizeThread.
Referenced by folly::annotate_rwlock_create().
void folly::detail::annotate_rwlock_create_static_impl | ( | void const volatile *const | addr, |
char const *const | f, | ||
int const | l | ||
) |
Definition at line 67 of file SanitizeThread.cpp.
References AnnotateRWLockCreateStatic(), FOLLY_SANITIZE_THREAD_CALL_HOOK, and folly::kIsSanitizeThread.
Referenced by folly::annotate_rwlock_create_static().
void folly::detail::annotate_rwlock_destroy_impl | ( | void const volatile *const | addr, |
char const *const | f, | ||
int const | l | ||
) |
Definition at line 76 of file SanitizeThread.cpp.
References AnnotateRWLockDestroy(), FOLLY_SANITIZE_THREAD_CALL_HOOK, and folly::kIsSanitizeThread.
Referenced by folly::annotate_rwlock_destroy().
void folly::detail::annotate_rwlock_released_impl | ( | void const volatile *const | addr, |
annotate_rwlock_level const | w, | ||
char const *const | f, | ||
int const | l | ||
) |
Definition at line 107 of file SanitizeThread.cpp.
References AnnotateRWLockReleased(), FOLLY_SANITIZE_THREAD_CALL_HOOK, and folly::kIsSanitizeThread.
Referenced by folly::annotate_rwlock_released().
void folly::detail::annotate_rwlock_try_acquired_impl | ( | void const volatile *const | addr, |
annotate_rwlock_level const | w, | ||
bool const | result, | ||
char const *const | f, | ||
int const | l | ||
) |
Definition at line 96 of file SanitizeThread.cpp.
References folly::annotate_rwlock_acquired().
Container&& folly::detail::as_sorted | ( | Container && | container, |
Compare const & | comp | ||
) |
Definition at line 199 of file sorted_vector_types.h.
References folly::test::begin(), folly::test::end(), and folly::T.
void folly::detail::assertionFailure | ( | const char * | expr, |
const char * | msg, | ||
const char * | file, | ||
unsigned int | line, | ||
const char * | function | ||
) |
Definition at line 34 of file SafeAssert.cpp.
References folly::fsyncNoInt(), uint32_t, folly::uint64ToBufferUnsafe(), and folly::writeFull().
void folly::detail::assume_check | ( | bool | cond | ) |
Definition at line 25 of file Assume.cpp.
Referenced by folly::assume().
|
inline |
|
inline |
Definition at line 258 of file String-inl.h.
References folly::Range< Iter >::size(), and folly::Range< Iter >::start().
bool folly::detail::atomic_fetch_reset_default | ( | Atomic & | atomic, |
std::size_t | bit, | ||
std::memory_order | order | ||
) |
Definition at line 53 of file AtomicUtil-inl.h.
Referenced by folly::atomic_fetch_reset(), and folly::TEST_F().
|
noexcept |
Definition at line 228 of file AtomicUtil-inl.h.
Referenced by folly::atomic_fetch_reset(), and folly::TEST_F().
bool folly::detail::atomic_fetch_set_default | ( | Atomic & | atomic, |
std::size_t | bit, | ||
std::memory_order | order | ||
) |
Definition at line 43 of file AtomicUtil-inl.h.
Referenced by folly::atomic_fetch_set(), and folly::TEST_F().
|
noexcept |
Definition at line 224 of file AtomicUtil-inl.h.
Referenced by folly::atomic_fetch_set(), and folly::TEST_F().
void folly::detail::atomic_hash_spin_wait | ( | Cond | condition | ) |
Definition at line 30 of file AtomicHashUtils.h.
References folly::asm_volatile_pause(), i, and folly::fibers::yield().
Referenced by folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::insertInternal(), and folly::AtomicHashMap< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::insertInternal().
ReturnType folly::detail::avgHelper | ( | long double | sum, |
uint64_t | count | ||
) |
Definition at line 34 of file Bucket.h.
References count, type, and folly::value().
std::enable_if< !std::is_same<typename std::remove_cv<ValueType>::type, long double>::value, ReturnType>::type folly::detail::avgHelper | ( | ValueType | sum, |
uint64_t | count | ||
) |
constexpr std::make_signed_t<Dst> folly::detail::bits_to_signed | ( | Src const | s | ) |
Definition at line 66 of file Bits.h.
References folly::to_signed(), folly::to_unsigned(), and value.
Referenced by folly::findFirstSet().
constexpr std::make_unsigned_t<Dst> folly::detail::bits_to_unsigned | ( | Src const | s | ) |
Definition at line 71 of file Bits.h.
References folly::to_unsigned(), and value.
Referenced by folly::findLastSet(), and folly::popcount().
void folly::detail::bulk_insert | ( | OurContainer & | sorted, |
Vector & | cont, | ||
InputIterator | first, | ||
InputIterator | last | ||
) |
Definition at line 161 of file sorted_vector_types.h.
References a, b, folly::copy(), and distance_if_multipass().
Referenced by folly::sorted_vector_set< folly::RequestData * >::insert(), and folly::sorted_vector_map< Key, Value, Compare, Allocator, GrowthPolicy, Container >::insert().
|
inline |
|
inline |
Definition at line 69 of file AtomicHashArray.h.
Referenced by folly::AtomicHashArray< KeyT, ValueT, HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn >::checkLegalKeyIfKey().
|
inline |
Definition at line 76 of file AtomicHashArray.h.
Expected<time_t, ConversionCode> folly::detail::chronoRangeCheck | ( | Src | value | ) |
This converts a number in some input type to time_t while ensuring that it fits in the range of numbers representable by time_t.
This is similar to the normal folly::tryTo() behavior when converting arthmetic types to an integer type, except that it does not complain about floating point conversions losing precision.
Definition at line 75 of file Conv.h.
References folly::makeUnexpected(), max, folly::NEGATIVE_OVERFLOW, folly::POSITIVE_OVERFLOW, value, and folly::value().
Referenced by durationToPosixTime().
constexpr D folly::detail::constexpr_clamp_cast_helper | ( | S | src, |
S | sl, | ||
S | su, | ||
D | dl, | ||
D | du | ||
) |
Definition at line 356 of file ConstexprMath.h.
References D, type, and value.
Referenced by folly::constexpr_clamp_cast().
constexpr std::size_t folly::detail::constexpr_find_first_set_ | ( | std::size_t | s, |
std::size_t | a, | ||
U const | u | ||
) |
Definition at line 196 of file ConstexprMath.h.
Referenced by folly::constexpr_find_first_set().
Definition at line 142 of file ConstexprMath.h.
References folly::T.
Referenced by folly::constexpr_log2().
Definition at line 147 of file ConstexprMath.h.
References folly::T.
Referenced by folly::constexpr_log2_ceil().
Definition at line 152 of file ConstexprMath.h.
References folly::pushmi::detail::t.
Referenced by folly::constexpr_pow().
constexpr int folly::detail::constexpr_strcmp_internal | ( | const Char * | s1, |
const Char * | s2 | ||
) |
Definition at line 49 of file Constexpr.h.
Referenced by folly::constexpr_strcmp().
constexpr size_t folly::detail::constexpr_strlen_internal | ( | const Char * | s, |
size_t | len | ||
) |
Definition at line 30 of file Constexpr.h.
References testing::gmock_generated_actions_test::Char().
Referenced by folly::detail::fixedstring::checkNullTerminated(), and folly::constexpr_strlen().
|
noexcept |
|
noexcept |
Checked conversion from integral to integral. The checks are only performed when meaningful, e.g. conversion from int to long goes unchecked.
Definition at line 1217 of file Conv.h.
References folly::ARITH_NEGATIVE_OVERFLOW, folly::ARITH_POSITIVE_OVERFLOW, folly::greater_than(), folly::less_than(), folly::makeUnexpected(), max, min, type, value, and folly::value().
|
noexcept |
Checked conversion from floating to floating. The checks are only performed when meaningful, e.g. conversion from float to double goes unchecked.
Definition at line 1245 of file Conv.h.
References folly::ARITH_NEGATIVE_OVERFLOW, folly::ARITH_POSITIVE_OVERFLOW, folly::makeUnexpected(), max, type, and folly::value().
|
noexcept |
Checked conversion from integral to floating point and back. The result must be convertible back to the source type without loss of precision. This seems Draconian but sometimes is what's needed, and complements existing routines nicely. For various rounding routines, see <math>.
Definition at line 1323 of file Conv.h.
References folly::ARITH_LOSS_OF_PRECISION, LIKELY, folly::makeUnexpected(), and folly::value().
int folly::detail::cplus_demangle_v3_callback_wrapper | ( | char const *const | mangled, |
void(*)(char const *, std::size_t, void *) | cbref, | ||
void *const | opaque | ||
) |
Definition at line 32 of file Demangle.cpp.
Definition at line 166 of file Crc32CombineDetail.cpp.
References folly::crc32_append_zeroes(), and folly::gf_multiply_crc32_hw().
Referenced by folly::crc32_combine().
Definition at line 161 of file Crc32CombineDetail.cpp.
References folly::crc32_append_zeroes(), and folly::gf_multiply_sw().
Referenced by folly::crc32_combine().
uint32_t folly::detail::crc32_hw | ( | const uint8_t * | data, |
size_t | nbytes, | ||
uint32_t | startingChecksum = ~0U |
||
) |
Compute a CRC-32 checksum of a buffer using a hardware-accelerated implementation.
Definition at line 76 of file Checksum.cpp.
Referenced by benchmarkHardwareCRC32(), folly::crc32(), and TEST().
bool folly::detail::crc32_hw_supported | ( | ) |
Check whether a hardware-accelerated CRC-32 implementation is supported on the current CPU.
Definition at line 87 of file Checksum.cpp.
Referenced by benchmarkHardwareCRC32(), folly::crc32(), folly::crc32_combine(), and folly::crc32c_combine().
uint32_t folly::detail::crc32_sw | ( | const uint8_t * | data, |
size_t | nbytes, | ||
uint32_t | startingChecksum = ~0U |
||
) |
Compute a CRC-32 checksum of a buffer using a portable, software-only implementation.
Definition at line 121 of file Checksum.cpp.
References folly::data(), and uint32_t.
Referenced by benchmarkSoftwareCRC32(), folly::crc32(), and TEST().
Definition at line 178 of file Crc32CombineDetail.cpp.
References folly::crc32_append_zeroes(), and folly::gf_multiply_crc32c_hw().
Referenced by folly::crc32c_combine().
Definition at line 172 of file Crc32CombineDetail.cpp.
References folly::crc32_append_zeroes(), and folly::gf_multiply_sw().
Referenced by folly::crc32c_combine().
uint32_t folly::detail::crc32c_hw | ( | const uint8_t * | data, |
size_t | nbytes, | ||
uint32_t | startingChecksum = ~0U |
||
) |
Compute a CRC-32C checksum of a buffer using a hardware-accelerated implementation.
Definition at line 292 of file Crc32cDetail.cpp.
Referenced by benchmarkHardwareCRC32C(), folly::crc32c(), and TEST().
bool folly::detail::crc32c_hw_supported | ( | ) |
Check whether a hardware-accelerated CRC-32C implementation is supported on the current CPU.
Definition at line 83 of file Checksum.cpp.
Referenced by benchmarkHardwareCRC32C(), folly::crc32c(), and TEST().
uint32_t folly::detail::crc32c_sw | ( | const uint8_t * | data, |
size_t | nbytes, | ||
uint32_t | startingChecksum = ~0U |
||
) |
Compute a CRC-32C checksum of a buffer using a portable, software-only implementation.
Definition at line 115 of file Checksum.cpp.
References folly::data(), and uint32_t.
Referenced by benchmarkSoftwareCRC32C(), folly::crc32c(), and TEST().
uint32_t folly::detail::crc_sw | ( | const uint8_t * | data, |
size_t | nbytes, | ||
uint32_t | startingChecksum | ||
) |
Definition at line 93 of file Checksum.cpp.
References sum(), and uint32_t.
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T* folly::detail::createGlobal | ( | F && | creator | ) |
Definition at line 70 of file StaticSingletonManager.h.
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T* folly::detail::createGlobal | ( | ) |
|
inline |
Definition at line 24 of file AtomicUtils.h.
Referenced by folly::AtomicStruct< folly::IndexedMemPool::TaggedPtr, Atom >::compare_exchange_strong(), folly::atomic_shared_ptr< T, Atom, CountedDetail >::compare_exchange_strong(), folly::test::DeterministicAtomicImpl< T, Schedule, Atom >::compare_exchange_strong(), folly::AtomicStruct< folly::IndexedMemPool::TaggedPtr, Atom >::compare_exchange_weak(), folly::atomic_shared_ptr< T, Atom, CountedDetail >::compare_exchange_weak(), and folly::test::DeterministicAtomicImpl< T, Schedule, Atom >::compare_exchange_weak().
|
inline |
Definition at line 264 of file String-inl.h.
References c.
Referenced by internalJoinAppend(), and internalSplit().
|
inline |
Definition at line 269 of file String-inl.h.
References folly::Range< Iter >::empty(), and folly::Range< Iter >::start().
|
inline |
Definition at line 249 of file String-inl.h.
Referenced by internalJoin(), internalJoinAppend(), internalSplit(), and splitFixed().
|
inline |
Definition at line 252 of file String-inl.h.
References folly::Range< Iter >::size().
|
inlinenoexcept |
String represented as a pair of pointers to char to signed/unsigned integrals. Assumes NO whitespace before or after, and also that the string is composed entirely of digits (and an optional sign only for signed types). String may be empty, in which case digits_to returns an appropriate error.
Definition at line 533 of file Conv.cpp.
References b, folly::digits10(), digits_to< char >(), digits_to< int >(), digits_to< long >(), digits_to< long long >(), digits_to< short >(), digits_to< signed char >(), digits_to< unsigned char >(), digits_to< unsigned int >(), digits_to< unsigned long >(), digits_to< unsigned long long >(), digits_to< unsigned short >(), int32_t, folly::makeUnexpected(), folly::NO_DIGITS, folly::pushmi::__adl::noexcept(), folly::NON_DIGIT_CHAR, folly::size(), folly::SUCCESS, sum(), type, UNLIKELY, and value.
Referenced by folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by digits_to(), and folly::toAppendStrImpl().
int folly::detail::distance_if_multipass | ( | Iterator | first, |
Iterator | last | ||
) |
Definition at line 122 of file sorted_vector_types.h.
References value.
Referenced by bulk_insert().
Definition at line 83 of file DoubleRadixSort.cpp.
References double_radix_sort_rec().
Referenced by folly::TDigest::merge(), and TEST().
|
static |
Definition at line 36 of file DoubleRadixSort.cpp.
References getRadixBucket(), i, and uint64_t.
Referenced by double_radix_sort().
std::enable_if<HasLess<U, T>::value, bool>::type folly::detail::downTo | ( | T & | iter, |
const U & | begin | ||
) |
std::enable_if<!HasLess<U, T>::value, bool>::type folly::detail::downTo | ( | T & | iter, |
const U & | begin | ||
) |
|
static |
Convert a std::chrono::duration with second granularity to a pair of (seconds, subseconds)
The SubsecondRatio template parameter specifies what type of subseconds to return. This must have a numerator of 1.
Definition at line 96 of file Conv.h.
References chronoRangeCheck(), folly::makeUnexpected(), folly::NEGATIVE_OVERFLOW, and value.
|
static |
Convert a std::chrono::duration with subsecond granularity to a pair of (seconds, subseconds)
Definition at line 127 of file Conv.h.
References chronoRangeCheck(), folly::makeUnexpected(), folly::NEGATIVE_OVERFLOW, and UNLIKELY.
|
static |
Convert a std::chrono::duration with coarser-than-second granularity to a pair of (seconds, subseconds)
Definition at line 157 of file Conv.h.
References folly::makeUnexpected(), max, folly::NEGATIVE_OVERFLOW, folly::POSITIVE_OVERFLOW, and value.
Expected<std::pair<time_t, long>, ConversionCode> folly::detail::durationToPosixTime | ( | const std::chrono::duration< Rep, Period > & | duration | ) |
Convert a std::chrono::duration to a pair of (seconds, subseconds)
This overload is only used for unusual durations where neither the numerator nor denominator are 1.
Definition at line 229 of file Conv.h.
References folly::makeUnexpected(), max, min, folly::NEGATIVE_OVERFLOW, and folly::POSITIVE_OVERFLOW.
|
inline |
Keep this implementation around for prettyToDouble().
Definition at line 130 of file Conv.h.
References enforceWhitespaceErr(), folly::makeConversionError(), folly::SUCCESS, folly::throw_exception(), type, and folly::value().
Referenced by folly::prettyToDouble().
|
inline |
Enforce that the suffix following a number is made up only of whitespace.
Definition at line 118 of file Conv.h.
References c, folly::NON_WHITESPACE_AFTER_END, folly::SUCCESS, and UNLIKELY.
Referenced by enforceWhitespace(), and folly::detail::CheckTrailingSpace::operator()().
|
inline |
QuantileEstimates folly::detail::estimatesFromDigest | ( | const TDigest & | digest, |
Range< const double * > | quantiles | ||
) |
Definition at line 22 of file QuantileEstimator.cpp.
References folly::Range< Iter >::begin(), folly::QuantileEstimates::count, folly::TDigest::count(), folly::Range< Iter >::end(), folly::TDigest::estimateQuantile(), folly::QuantileEstimates::quantiles, folly::Range< Iter >::size(), folly::QuantileEstimates::sum, and folly::TDigest::sum().
Referenced by folly::SimpleQuantileEstimator< ClockT >::estimateQuantiles(), and folly::SlidingWindowQuantileEstimator< ClockT >::estimateQuantiles().
auto folly::detail::extract_default | ( | const KeysDefault &... | keysDefault | ) | -> typename DefaultType<KeysDefault...>::type const& |
Definition at line 213 of file MapUtil.h.
References folly::pushmi::operators::get.
Referenced by folly::get_default(), and folly::get_ref_default().
auto folly::detail::fallbackFormatOneArg | ( | std::string * | str, |
const Arg * | arg, | ||
int | |||
) | -> decltype( toAppend(std::declval<Arg>(), std::declval<std::string*>()), std::declval<void>()) |
Definition at line 42 of file LogStreamProcessor.h.
References folly::demangle(), and folly::toAppend().
Referenced by folly::LogStreamProcessor::fallbackFormat().
|
inline |
Definition at line 59 of file LogStreamProcessor.h.
References folly::demangle(), and folly::toAppend().
|
inline |
Definition at line 30 of file IPAddress.h.
References familyNameStrDefault(), and getNthMSBitImplThrow().
Referenced by getNthMSBitImplThrow(), folly::IPAddressV4::getNthMSByte(), folly::IPAddressV6::getNthMSByte(), folly::operator<(), and folly::toAppend().
std::string folly::detail::familyNameStrDefault | ( | sa_family_t | family | ) |
Definition at line 24 of file IPAddress.cpp.
References folly::sformat().
Referenced by familyNameStr().
|
inline |
Definition at line 239 of file IPAddressSource.h.
References fastIpV4ToBufferUnsafe().
Referenced by folly::IPAddressV4::toFullyQualifiedAppend().
|
inline |
Definition at line 219 of file IPAddressSource.h.
References uint8_t.
Referenced by fastIpv4AppendToString(), and fastIpv4ToString().
|
inline |
Definition at line 234 of file IPAddressSource.h.
References fastIpV4ToBufferUnsafe(), and string.
Referenced by folly::IPAddressV4::str(), and TEST().
|
inline |
Definition at line 272 of file IPAddressSource.h.
References fastIpv6ToBufferUnsafe().
Referenced by folly::IPAddressV6::toFullyQualifiedAppend().
|
inline |
Definition at line 244 of file IPAddressSource.h.
References i, uint16_t, and writeIntegerString().
Referenced by fastIpv6AppendToString(), and fastIpv6ToString().
|
inline |
Definition at line 267 of file IPAddressSource.h.
References fastIpv6ToBufferUnsafe(), and string.
Referenced by TEST(), and folly::IPAddressV6::toFullyQualified().
folly::detail::FOLLY_CREATE_MEMBER_INVOKE_TRAITS | ( | AllocatorConstruct_ | , |
construct | |||
) |
folly::detail::FOLLY_CREATE_MEMBER_INVOKE_TRAITS | ( | AllocatorDestroy_ | , |
destroy | |||
) |
FOLLY_PUSH_WARNING folly::detail::FOLLY_MSVC_DISABLE_WARNING | ( | 4388 | ) |
FutexResult folly::detail::futexWait | ( | const Futex * | futex, |
uint32_t | expected, | ||
uint32_t | waitMask = -1 |
||
) |
Puts the thread to sleep if this->load() == expected. Returns true when it is returning because it has consumed a wake() event, false for any other return (signal, this->load() != expected, or spurious wakeup).
Definition at line 100 of file Futex-inl.h.
References futexWaitImpl(), and TIMEDOUT.
Referenced by folly::detail::atomic_notification::atomic_wait_impl(), BENCHMARK(), folly::detail::distributed_mutex::doFutexWait(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForever::doWait(), folly::detail::MemoryIdler::futexWait(), folly::MicroLockCore::lockSlowPath(), MockAtom< T >::MockAtom(), run_basic_tests(), run_basic_thread(), run_wake_blocked_test(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::tryBlockingPop(), folly::detail::TurnSequencer< std::atomic >::tryWaitForTurn(), folly::EventCount::wait(), and folly::detail::ThreadCachedInts< folly::detail::folly::detail::Tag >::waitForZero().
FutexResult folly::detail::futexWaitImpl | ( | const Futex< std::atomic > * | futex, |
uint32_t | expected, | ||
std::chrono::system_clock::time_point const * | absSystemTime, | ||
std::chrono::steady_clock::time_point const * | absSteadyTime, | ||
uint32_t | waitMask | ||
) |
Referenced by futexWait(), futexWaitImpl(), futexWaitUntil(), and time_point_conv().
FutexResult folly::detail::futexWaitImpl | ( | const Futex< EmulatedFutexAtomic > * | futex, |
uint32_t | expected, | ||
std::chrono::system_clock::time_point const * | absSystemTime, | ||
std::chrono::steady_clock::time_point const * | absSteadyTime, | ||
uint32_t | waitMask | ||
) |
std::enable_if<Deadline::clock::is_steady, FutexResult>::type folly::detail::futexWaitImpl | ( | Futex * | futex, |
uint32_t | expected, | ||
Deadline const & | deadline, | ||
uint32_t | waitMask | ||
) |
Definition at line 80 of file Futex-inl.h.
References futexWaitImpl(), and type.
std::enable_if<!Deadline::clock::is_steady, FutexResult>::type folly::detail::futexWaitImpl | ( | Futex * | futex, |
uint32_t | expected, | ||
Deadline const & | deadline, | ||
uint32_t | waitMask | ||
) |
Definition at line 90 of file Futex-inl.h.
References futexWaitImpl().
FutexResult folly::detail::futexWaitImpl | ( | const Futex< std::atomic > * | futex, |
uint32_t | expected, | ||
system_clock::time_point const * | absSystemTime, | ||
steady_clock::time_point const * | absSteadyTime, | ||
uint32_t | waitMask | ||
) |
FutexResult folly::detail::futexWaitImpl | ( | const Futex< EmulatedFutexAtomic > * | futex, |
uint32_t | expected, | ||
system_clock::time_point const * | absSystemTime, | ||
steady_clock::time_point const * | absSteadyTime, | ||
uint32_t | waitMask | ||
) |
FutexResult folly::detail::futexWaitUntil | ( | const Futex * | futex, |
uint32_t | expected, | ||
std::chrono::time_point< Clock, Duration > const & | deadline, | ||
uint32_t | waitMask = -1 |
||
) |
Similar to futexWait but also accepts a deadline until when the wait call may block.
Optimal clock types: std::chrono::system_clock, std::chrono::steady_clock. NOTE: On some systems steady_clock is just an alias for system_clock, and is not actually steady.
For any other clock type, now() will be invoked twice.
Definition at line 112 of file Futex-inl.h.
References futexWaitImpl(), max, and type.
Referenced by folly::detail::atomic_notification::atomic_wait_until_impl(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::canEnqueue(), deterministicAtomicWaitUntilTests(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::doWait(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitUntilDeadline< Clock, Duration >::doWait(), folly::detail::MemoryIdler::futexWaitPreIdle(), folly::detail::MemoryIdler::futexWaitUntil(), liveClockWaitUntilTests(), MockAtom< T >::MockAtom(), TEST(), and folly::detail::TurnSequencer< std::atomic >::tryWaitForTurn().
int folly::detail::futexWake | ( | const Futex * | futex, |
int | count = std::numeric_limits< int >::max() , |
||
uint32_t | wakeMask = -1 |
||
) |
Wakes up to count waiters where (waitMask & wakeMask) != 0, returning the number of awoken threads, or -1 if an error occurred. Note that when constructing a concurrency primitive that can guard its own destruction, it is likely that you will want to ignore EINVAL here (as well as making sure that you never touch the object after performing the memory store that is the linearization point for unlock or control handoff). See https://sourceware.org/bugzilla/show_bug.cgi?id=13690
Definition at line 107 of file Futex-inl.h.
References futexWakeImpl().
Referenced by folly::detail::atomic_notification::atomic_notify_all_impl(), folly::detail::atomic_notification::atomic_notify_one_impl(), BENCHMARK(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::blockingPushImpl(), folly::detail::TurnSequencer< std::atomic >::completeTurn(), folly::detail::ThreadCachedInts< folly::detail::folly::detail::Tag >::decrement(), folly::detail::distributed_mutex::doFutexWake(), folly::EventCount::doNotify(), folly::SharedMutexImpl< true >::futexWakeAll(), liveClockWaitUntilTests(), folly::Baton< MayBlock, Atom >::post(), folly::SaturatingSemaphore< MayBlock, Atom >::postSlowWaiterMayBlock(), folly::fibers::Baton::postThread(), run_basic_tests(), run_wake_blocked_test(), folly::DynamicBoundedQueue< T, SingleProducer, SingleConsumer, MayBlock, LgSegmentSize, LgAlign, WeightFn, Atom >::transferCredit(), folly::MicroLockCore::unlock(), folly::SharedMutexImpl< true >::wakeRegisteredWaitersImpl(), and folly::detail::ThreadCachedInts< Tag >::Integer::~Integer().
int folly::detail::futexWakeImpl | ( | const Futex< std::atomic > * | futex, |
int | count, | ||
uint32_t | wakeMask | ||
) |
Available overloads, with definitions elsewhere
These functions are treated as ADL-extension points, the templates above call these functions without them having being pre-declared. This works because ADL lookup finds the definitions of these functions when you pass the relevant arguments
Definition at line 227 of file Futex.cpp.
Referenced by futexWake(), and time_point_conv().
int folly::detail::futexWakeImpl | ( | const Futex< EmulatedFutexAtomic > * | futex, |
int | count, | ||
uint32_t | wakeMask | ||
) |
auto folly::detail::getLastElement | ( | const Ts &... | ts | ) | -> decltype(LastElementImpl<Ts...>::call(ts...)) |
Definition at line 232 of file Conv.h.
References folly::detail::LastElementImpl< Ts >::call().
Referenced by folly::reserveInTargetDelim(), folly::to(), and folly::toAppendStrImpl().
|
inline |
Definition at line 49 of file IPAddress.h.
References getNthMSBitImplThrow().
Referenced by folly::IPAddressV4::getNthMSBit(), and folly::IPAddressV6::getNthMSBit().
void folly::detail::getNthMSBitImplThrow | ( | size_t | bitCount, |
sa_family_t | family | ||
) |
Definition at line 28 of file IPAddress.cpp.
References familyNameStr(), and folly::sformat().
Referenced by familyNameStr(), and getNthMSBitImpl().
FOLLY_ALWAYS_INLINE auto folly::detail::getPointer | ( | const Iterator & | it, |
long | |||
) | -> decltype(std::addressof(*it)) |
Definition at line 68 of file Enumerate.h.
Referenced by folly::detail::Enumerator< Iterator >::Proxy::operator->().
FOLLY_ALWAYS_INLINE auto folly::detail::getPointer | ( | const Iterator & | it, |
int | |||
) | -> decltype(it.operator->()) |
Definition at line 73 of file Enumerate.h.
Definition at line 27 of file DoubleRadixSort.cpp.
References int64_t, uint64_t, and val.
Referenced by double_radix_sort_rec().
std::shared_ptr< Timekeeper > folly::detail::getTimekeeperSingleton | ( | ) |
Definition at line 159 of file ThreadWheelTimekeeper.cpp.
Referenced by folly::futures::sleep(), and folly::futures::detail::FutureBase< T >::withinImplementation().
bool folly::detail::greater_than_impl | ( | LHS const | lhs | ) |
void folly::detail::handleMallctlError | ( | const char * | cmd, |
int | err | ||
) |
Definition at line 27 of file MallctlHelper.cpp.
References folly::errnoStr(), and folly::sformat().
Referenced by mallctlHelper().
constexpr int folly::detail::hazptr_domain_rcount_threshold | ( | ) |
size_t folly::detail::hexDumpLine | ( | const void * | ptr, |
size_t | offset, | ||
size_t | size, | ||
std::string & | line | ||
) |
Hex-dump at most 16 bytes starting at offset from a memory area of size bytes. Return the number of bytes actually dumped.
Definition at line 651 of file String.cpp.
References c, i, min, ptr, and uint8_t.
Referenced by folly::hexDump(), and folly::unhexlify().
OurContainer::iterator folly::detail::insert_with_hint | ( | OurContainer & | sorted, |
Vector & | cont, | ||
typename OurContainer::iterator | hint, | ||
typename OurContainer::value_type && | value, | ||
GrowthPolicy & | po | ||
) |
Definition at line 131 of file sorted_vector_types.h.
References folly::gen::move, and folly::value().
Referenced by folly::sorted_vector_set< folly::RequestData * >::insert(), and folly::sorted_vector_map< Key, Value, Compare, Allocator, GrowthPolicy, Container >::insert().
void folly::detail::insertThousandsGroupingUnsafe | ( | char * | start_buffer, |
char ** | end_buffer | ||
) |
Definition at line 387 of file Format.cpp.
Referenced by folly::FormatValue< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value >::type >::doFormat(), and testGrouping().
std::enable_if<IsSizableStringContainerIterator<Iterator>::value>::type folly::detail::internalJoin | ( | Delim | delimiter, |
Iterator | begin, | ||
Iterator | end, | ||
String & | output | ||
) |
Definition at line 469 of file String-inl.h.
References folly::test::begin(), delimSize(), internalJoinAppend(), folly::size(), and type.
Referenced by folly::join().
std::enable_if< !IsSizableStringContainerIterator<Iterator>::value>::type folly::detail::internalJoin | ( | Delim | delimiter, |
Iterator | begin, | ||
Iterator | end, | ||
String & | output | ||
) |
Definition at line 487 of file String-inl.h.
References internalJoinAppend().
void folly::detail::internalJoinAppend | ( | Delim | delimiter, |
Iterator | begin, | ||
Iterator | end, | ||
String & | output | ||
) |
Definition at line 451 of file String-inl.h.
References delimFront(), delimSize(), folly::toAppend(), type, and value.
Referenced by internalJoin().
void folly::detail::internalSplit | ( | DelimT | delim, |
StringPiece | sp, | ||
OutputIterator | out, | ||
bool | ignoreEmpty | ||
) |
Definition at line 284 of file String-inl.h.
References atDelim(), delimFront(), delimSize(), folly::Range< Iter >::empty(), i, s, folly::Range< Iter >::size(), folly::Range< Iter >::start(), folly::Range< Iter >::subpiece(), and value.
EnableForArgTypes<Fn> folly::detail::invokeForKeyValue | ( | Fn | f, |
const folly::dynamic & | , | ||
const folly::dynamic & | |||
) |
Definition at line 102 of file DynamicParser-inl.h.
References f.
Referenced by folly::DynamicParser::parse().
EnableForArgTypes<Fn, folly::dynamic> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | , | ||
const folly::dynamic & | v | ||
) |
Definition at line 111 of file DynamicParser-inl.h.
EnableForArgTypes<Fn, int64_t> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | , | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, bool> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | , | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, double> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | , | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, std::string> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | , | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, folly::dynamic, folly::dynamic> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
Definition at line 148 of file DynamicParser-inl.h.
EnableForArgTypes<Fn, folly::dynamic, int64_t> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, folly::dynamic, bool> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, folly::dynamic, double> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, folly::dynamic, std::string> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, std::string, folly::dynamic> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, std::string, int64_t> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
Definition at line 187 of file DynamicParser-inl.h.
References folly::dynamic::asInt(), and folly::dynamic::asString().
EnableForArgTypes<Fn, std::string, bool> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
Definition at line 193 of file DynamicParser-inl.h.
References folly::dynamic::asBool(), and folly::dynamic::asString().
EnableForArgTypes<Fn, std::string, double> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
Definition at line 199 of file DynamicParser-inl.h.
References folly::dynamic::asDouble(), and folly::dynamic::asString().
EnableForArgTypes<Fn, std::string, std::string> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, int64_t, folly::dynamic> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, int64_t, int64_t> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
EnableForArgTypes<Fn, int64_t, bool> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
Definition at line 226 of file DynamicParser-inl.h.
References folly::dynamic::asBool(), and folly::dynamic::asInt().
EnableForArgTypes<Fn, int64_t, double> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
Definition at line 232 of file DynamicParser-inl.h.
References folly::dynamic::asDouble(), and folly::dynamic::asInt().
EnableForArgTypes<Fn, int64_t, std::string> folly::detail::invokeForKeyValue | ( | Fn | fn, |
const folly::dynamic & | k, | ||
const folly::dynamic & | v | ||
) |
Definition at line 238 of file DynamicParser-inl.h.
References folly::dynamic::asInt(), and folly::dynamic::asString().
FOLLY_PUSH_WARNING RHS LHS bool folly::detail::less_than_impl | ( | LHS const | lhs | ) |
auto folly::detail::lock | ( | SynchronizedLocker... | lockersIn | ) | -> std::tuple<typename SynchronizedLocker::LockedPtr...> |
Acquire locks for multiple Synchronized<T> objects, in a deadlock-safe manner.
The function uses the "smart and polite" algorithm from this link http://howardhinnant.github.io/dining_philosophers.html#Polite
The gist of the algorithm is that it locks a mutex, then tries to lock the other mutexes in a non-blocking manner. If all the locks succeed, we are done, if not, we release the locks we have held, yield to allow other threads to continue and then block on the mutex that we failed to acquire.
This allows dynamically yielding ownership of all the mutexes but one, so that other threads can continue doing work and locking the other mutexes. See the benchmarks in folly/test/SynchronizedBenchmark.cpp for more.
Definition at line 871 of file Synchronized.h.
References testing::Args(), folly::fetch(), folly::for_each(), folly::loop_break, folly::loop_continue, folly::gen::move, and folly::fibers::yield().
Referenced by testing::UnitTest::AddTestPartResult(), BENCHMARK(), burn(), testing::UnitTest::current_test_case(), testing::UnitTest::current_test_info(), testing::internal::linked_ptr_internal::depart(), folly::ssl::detail::dyn_destroy(), testing::internal::UnitTestImpl::GetGlobalTestPartResultReporter(), wangle::ThreadSafeSSLSessionCache::getSSLSession(), testing::internal::GetThreadCount(), folly::ssl::detail::isSSLLockDisabled(), testing::internal::linked_ptr_internal::join(), folly::LockPolicyExclusive::lock(), folly::lock(), testing::internal::NoDefaultContructor::NoDefaultContructor(), folly::SharedPromise< T >::operator=(), testing::UnitTest::PopGTestTrace(), testing::UnitTest::PushGTestTrace(), wangle::LRUPersistentCache< K, V, MutexT >::put(), testing::TestResult::RecordProperty(), wangle::ThreadSafeSSLSessionCache::removeSSLSession(), runContended(), runFairness(), runUncontended(), testing::internal::UnitTestImpl::SetGlobalTestPartResultReporter(), wangle::ThreadSafeSSLSessionCache::setSSLSession(), testing::internal::ShouldRunTestCase(), wangle::ThreadSafeSSLSessionCache::size(), wangle::ThreadSafeSSLSessionCache::supportsPersistence(), TEST(), testing::internal::TEST(), testing::internal::To::To(), wangle::LRUPersistentCache< K, V, MutexT >::~LRUPersistentCache(), and testing::internal::ScopedPrematureExitFile::~ScopedPrematureExitFile().
auto folly::detail::lock | ( | Synchronized & | synchronized, |
Args &&... | args | ||
) |
Definition at line 955 of file Synchronized.h.
References a, makeSynchronizedLocker(), and s.
auto folly::detail::makeSynchronizedLocker | ( | Synchronized & | synchronized, |
LockFunc && | lockFunc, | ||
TryLockFunc && | tryLockFunc, | ||
Args &&... | args | ||
) |
Definition at line 837 of file Synchronized.h.
Referenced by lock(), folly::lock(), rlock(), ulock(), and wlock().
Definition at line 33 of file MallctlHelper.h.
References handleMallctlError(), mallctl, folly::T, UNLIKELY, and folly::usingJEMalloc().
Referenced by folly::mallctlRead(), folly::mallctlReadWrite(), and folly::mallctlWrite().
constexpr size_t folly::detail::max_align_ | ( | std::size_t | a | ) |
constexpr std::size_t folly::detail::max_align_ | ( | std::size_t | a, |
std::size_t | e, | ||
Es... | es | ||
) |
Definition at line 33 of file Align.h.
References max_align_().
std::enable_if< std::is_default_constructible<T>::value && !folly::is_trivially_copyable<T>::value>::type folly::detail::moveObjectsRight | ( | T * | first, |
T * | lastConstructed, | ||
T * | realLast | ||
) |
Definition at line 108 of file small_vector.h.
References folly::test::end(), folly::gen::move, T, type, and value.
std::enable_if< !std::is_default_constructible<T>::value || folly::is_trivially_copyable<T>::value>::type folly::detail::moveObjectsRight | ( | T * | first, |
T * | lastConstructed, | ||
T * | realLast | ||
) |
Definition at line 147 of file small_vector.h.
Referenced by folly::small_vector< Observer< T > *, InlineObservers >::insert(), and folly::small_vector< Observer< T > *, InlineObservers >::insertImpl().
std::enable_if< (std::is_arithmetic<T>::value && std::is_arithmetic<U>::value) || (std::is_pointer<T>::value && std::is_pointer<U>::value), bool>::type folly::detail::notThereYet | ( | T & | iter, |
const U & | end | ||
) |
notThereYet helps the FOR_EACH_RANGE macro by opportunistically using "<" instead of "!=" whenever available when checking for loop termination. This makes e.g. examples such as FOR_EACH_RANGE (i, 10, 5) execute zero iterations instead of looping virtually forever. At the same time, some iterator types define "!=" but not "<". The notThereYet function will dispatch differently for those.
Below is the correct implementation of notThereYet. It is disabled because of a bug in Boost 1.46: The filesystem::path::iterator defines operator< (via boost::iterator_facade), but that in turn uses distance_to which is undefined for that particular iterator. So HasLess (defined above) identifies boost::filesystem::path as properly comparable with <, but in fact attempting to do so will yield a compile-time error.
The else branch (active) contains a conservative implementation.
Definition at line 267 of file Foreach.h.
References folly::test::end(), type, and value.
std::enable_if< !((std::is_arithmetic<T>::value && std::is_arithmetic<U>::value) || (std::is_pointer<T>::value && std::is_pointer<U>::value)), bool>::type folly::detail::notThereYet | ( | T & | iter, |
const U & | end | ||
) |
dynamic folly::detail::numericOp | ( | dynamic const & | a, |
dynamic const & | b | ||
) |
Definition at line 169 of file dynamic-inl.h.
References a, folly::dynamic::asDouble(), folly::dynamic::asInt(), b, folly::dynamic::isDouble(), folly::dynamic::isInt(), folly::dynamic::isNumber(), and folly::dynamic::type().
ScopeGuardImpl<typename std::decay<FunctionType>::type, true> folly::detail::operator+ | ( | detail::ScopeGuardOnExit | , |
FunctionType && | fn | ||
) |
|
inline |
Definition at line 1447 of file Conv.h.
References folly::Range< Iter >::end(), folly::parseTo(), type, and folly::value().
Referenced by folly::to().
|
inline |
Definition at line 1456 of file Conv.h.
References folly::parseTo().
Definition at line 387 of file small_vector.h.
References T.
Referenced by folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::freeHeap(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::HeapPtr::getCapacity(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::heap(), and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::HeapPtr::setCapacity().
bool folly::detail::pointerFlagGet | ( | T * | p | ) |
Definition at line 383 of file small_vector.h.
Referenced by folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::HeapPtr::getCapacity(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::hasCapacity(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::heap(), and folly::small_vector< Observer< T > *, InlineObservers >::makeSizeInternal().
Definition at line 379 of file small_vector.h.
References T.
Referenced by folly::small_vector< Observer< T > *, InlineObservers >::makeSizeInternal().
constexpr size_t folly::detail::poly_size | ( | size_t | bits | ) |
Definition at line 55 of file Fingerprint.h.
Referenced by folly::Fingerprint< BITS >::size().
void folly::detail::populateMemForward | ( | T * | mem, |
std::size_t | n, | ||
Function const & | op | ||
) |
Definition at line 156 of file small_vector.h.
References i.
Referenced by folly::small_vector< Observer< T > *, InlineObservers >::constructImpl(), folly::small_vector< Observer< T > *, InlineObservers >::doConstruct(), and folly::small_vector< Observer< T > *, InlineObservers >::resize().
auto folly::detail::posixTimeToDuration | ( | Seconds | seconds, |
Subseconds | subseconds, | ||
std::chrono::duration< Rep, std::ratio< 1, 1 >> | dummy | ||
) | -> Expected<decltype(dummy), ConversionCode> |
Convert a timeval or a timespec to a std::chrono::duration with second granularity.
The SubsecondRatio template parameter specifies what type of subseconds to return. This must have a numerator of 1.
The input must be in normalized form: the subseconds field must be greater than or equal to 0, and less than SubsecondRatio::den (i.e., less than 1 second).
Definition at line 380 of file Conv.h.
References dummy(), folly::makeUnexpected(), folly::NEGATIVE_OVERFLOW, UNLIKELY, and value.
auto folly::detail::posixTimeToDuration | ( | Seconds | seconds, |
Subseconds | subseconds, | ||
std::chrono::duration< Rep, std::ratio< 1, Denominator >> | dummy | ||
) | -> Expected<decltype(dummy), ConversionCode> |
Convert a timeval or a timespec to a std::chrono::duration with subsecond granularity
Definition at line 424 of file Conv.h.
References dummy(), LIKELY, folly::makeUnexpected(), folly::SUCCESS, and value.
auto folly::detail::posixTimeToDuration | ( | Seconds | seconds, |
Subseconds | subseconds, | ||
std::chrono::duration< Rep, std::ratio< Numerator, 1 >> | dummy | ||
) | -> Expected<decltype(dummy), ConversionCode> |
Convert a timeval or a timespec to a std::chrono::duration with granularity coarser than 1 second.
Definition at line 469 of file Conv.h.
References dummy(), folly::makeUnexpected(), folly::NEGATIVE_OVERFLOW, UNLIKELY, and value.
auto folly::detail::posixTimeToDuration | ( | Seconds | seconds, |
Subseconds | subseconds, | ||
std::chrono::duration< Rep, std::ratio< Numerator, Denominator >> | dummy | ||
) | -> Expected<decltype(dummy), ConversionCode> |
Convert a timeval or timespec to a std::chrono::duration
This overload is only used for unusual durations where neither the numerator nor denominator are 1.
Definition at line 518 of file Conv.h.
References dummy(), and folly::makeUnexpected().
StringPiece folly::detail::prepareDelim | ( | const String & | s | ) |
Definition at line 328 of file String-inl.h.
Referenced by folly::join(), folly::split(), and folly::splitTo().
|
inline |
Definition at line 331 of file String-inl.h.
References c.
|
inline |
Definition at line 1349 of file Range.h.
References qfind_first_byte_of_nosse(), qfind_first_byte_of_sse42(), and folly::CpuId::sse42().
Referenced by BENCHMARK(), SseNeedleFinder::find_first_byte_of(), and folly::qfind_first_of().
size_t folly::detail::qfind_first_byte_of_bitset | ( | const StringPieceLite | haystack, |
const StringPieceLite | needles | ||
) |
Definition at line 27 of file RangeCommon.cpp.
References needle, s, folly::detail::StringPieceLite::size(), and uint8_t.
Referenced by BENCHMARK_RELATIVE(), and qfind_first_byte_of_std().
size_t folly::detail::qfind_first_byte_of_byteset | ( | const StringPieceLite | haystack, |
const StringPieceLite | needles | ||
) |
Definition at line 42 of file RangeCommon.cpp.
References folly::SparseByteSet::add(), folly::SparseByteSet::contains(), needle, s, folly::detail::StringPieceLite::size(), and uint8_t.
Referenced by BENCHMARK_RELATIVE(), ByteSetNeedleFinder::find_first_byte_of(), qfind_first_byte_of_nosse(), qfind_first_byte_of_sse42(), and qfind_first_byte_of_std().
|
inline |
Definition at line 92 of file RangeCommon.h.
References folly::detail::StringPieceLite::empty(), qfind_first_byte_of_byteset(), qfind_first_byte_of_std(), folly::detail::StringPieceLite::size(), and UNLIKELY.
Referenced by BENCHMARK_RELATIVE(), NoSseNeedleFinder::find_first_byte_of(), qfind_first_byte_of(), and qfind_first_byte_of_sse42().
size_t folly::detail::qfind_first_byte_of_sse42 | ( | const StringPieceLite | haystack, |
const StringPieceLite | needles | ||
) |
Definition at line 31 of file RangeSse42.cpp.
References addr, b, folly::detail::StringPieceLite::data(), folly::detail::StringPieceLite::empty(), folly::detail::StringPieceLite::end(), i, min, qfind_first_byte_of_byteset(), qfind_first_byte_of_nosse(), qfind_first_byte_of_std(), folly::detail::StringPieceLite::size(), folly::T, uint64_t, and UNLIKELY.
Referenced by qfind_first_byte_of().
|
inline |
Definition at line 72 of file RangeCommon.h.
References a, b, folly::detail::StringPieceLite::begin(), folly::detail::StringPieceLite::end(), qfind_first_byte_of_bitset(), and qfind_first_byte_of_byteset().
Referenced by BENCHMARK_RELATIVE(), qfind_first_byte_of_nosse(), and qfind_first_byte_of_sse42().
ReturnType folly::detail::rateHelper | ( | ReturnType | count, |
Duration | elapsed | ||
) |
void folly::detail::rawOverAlignedImpl | ( | Alloc const & | alloc, |
size_t | n, | ||
void *& | raw | ||
) |
Definition at line 97 of file Memory.h.
References a, folly::aligned_free(), folly::aligned_malloc(), folly::constexpr_min(), folly::T, and folly::value().
auto folly::detail::rlock | ( | Synchronized & | synchronized, |
Args &&... | args | ||
) |
Definition at line 935 of file Synchronized.h.
References a, testing::Args(), makeSynchronizedLocker(), and s.
Referenced by folly::rlock(), and runFairness().
std::unique_lock< std::mutex > folly::detail::sharedMutexAnnotationGuard | ( | void * | ptr | ) |
Definition at line 25 of file SharedMutex.cpp.
References folly::kIsSanitizeThread, and ptr.
Referenced by folly::SharedMutexImpl< true >::annotateLazyCreate().
std::vector<std::string> folly::detail::shellify | ( | StringPiece | format, |
Arguments &&... | arguments | ||
) |
Definition at line 43 of file Shell.h.
References folly::sformat(), and folly::shellQuote().
Referenced by folly::shellify().
|
inline |
Definition at line 390 of file small_vector.h.
References FOLLY_SV_PACK_PUSH, type, and testing::Value().
Referenced by folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::heap(), and folly::small_vector< Observer< T > *, InlineObservers >::makeSizeInternal().
|
static |
Referenced by folly::SingletonVault::defaultVaultType().
void folly::detail::singletonPrintDestructionStackTrace | ( | const TypeDescriptor & | type | ) |
Definition at line 159 of file Singleton.cpp.
References folly::detail::TypeDescriptor::name(), gmock_output_test::output, folly::SingletonVault::stackTraceGetter(), and string.
Referenced by folly::detail::SingletonHolder< T >::createInstance(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonThrowGetInvokedAfterDestruction | ( | const TypeDescriptor & | type | ) |
Definition at line 181 of file Singleton.cpp.
References folly::DFATAL, leakedSingletons_, folly::detail::TypeDescriptor::name(), folly::singleton, and string.
Referenced by folly::detail::SingletonHolder< T >::get(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonThrowNullCreator | ( | const std::type_info & | type | ) |
Definition at line 174 of file Singleton.cpp.
References folly::demangle(), and folly::sformat().
Referenced by folly::Singleton< folly::observer_detail::ObserverManager >::make_mock(), folly::LeakySingleton< T, Tag >::make_mock(), folly::detail::TypeDescriptorHasher::operator()(), and folly::Singleton< folly::observer_detail::ObserverManager >::Singleton().
void folly::detail::singletonWarnCreateBeforeRegistrationCompleteAndAbort | ( | const TypeDescriptor & | type | ) |
Definition at line 143 of file Singleton.cpp.
References folly::FATAL, folly::detail::TypeDescriptor::name(), and folly::SingletonVault::stackTraceGetter().
Referenced by folly::detail::SingletonHolder< T >::createInstance(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonWarnCreateCircularDependencyAndAbort | ( | const TypeDescriptor & | type | ) |
Definition at line 128 of file Singleton.cpp.
References folly::FATAL, and folly::detail::TypeDescriptor::name().
Referenced by folly::detail::SingletonHolder< T >::createInstance(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonWarnCreateUnregisteredAndAbort | ( | const TypeDescriptor & | type | ) |
Definition at line 133 of file Singleton.cpp.
References folly::FATAL, folly::detail::TypeDescriptor::name(), ptr, and folly::SingletonVault::stackTraceGetter().
Referenced by folly::detail::SingletonHolder< T >::createInstance(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonWarnDestroyInstanceLeak | ( | const TypeDescriptor & | type, |
const void * | ptr | ||
) |
Definition at line 115 of file Singleton.cpp.
References folly::detail::TypeDescriptor::name().
Referenced by folly::detail::SingletonHolder< T >::destroyInstance(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonWarnDoubleRegistrationAndAbort | ( | const TypeDescriptor & | type | ) |
Definition at line 77 of file Singleton.cpp.
References folly::detail::TypeDescriptor::name().
Referenced by folly::detail::SingletonHolder< T >::registerSingleton(), and folly::detail::SingletonHolder< T >::singleton().
void folly::detail::singletonWarnLeakyDoubleRegistrationAndAbort | ( | const TypeDescriptor & | type | ) |
Definition at line 88 of file Singleton.cpp.
References folly::detail::TypeDescriptor::name().
Referenced by folly::LeakySingleton< T, Tag >::LeakySingleton(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonWarnLeakyInstantiatingNotRegisteredAndAbort | ( | const TypeDescriptor & | type | ) |
Definition at line 99 of file Singleton.cpp.
References folly::FATAL, folly::detail::TypeDescriptor::name(), ptr, and folly::SingletonVault::stackTraceGetter().
Referenced by folly::LeakySingleton< T, Tag >::createInstance(), and folly::detail::TypeDescriptorHasher::operator()().
void folly::detail::singletonWarnRegisterMockEarlyAndAbort | ( | const TypeDescriptor & | type | ) |
Definition at line 109 of file Singleton.cpp.
References folly::FATAL, and folly::detail::TypeDescriptor::name().
Referenced by folly::detail::TypeDescriptorHasher::operator()(), and folly::detail::SingletonHolder< T >::registerSingletonMock().
spin_result folly::detail::spin_pause_until | ( | std::chrono::time_point< Clock, Duration > const & | deadline, |
WaitOptions const & | opt, | ||
F | f | ||
) |
Definition at line 36 of file Spin.h.
References advance, folly::asm_volatile_pause(), f, min, now(), folly::WaitOptions::spin_max(), success, and timeout.
Referenced by folly::UnboundedQueue< T, false, 6 >::getAllocNextSegment(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::trySpinBeforeBlock(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::tryWait(), folly::Baton< MayBlock, Atom >::tryWaitSlow(), and folly::SaturatingSemaphore< MayBlock, Atom >::tryWaitSlow().
spin_result folly::detail::spin_yield_until | ( | std::chrono::time_point< Clock, Duration > const & | deadline, |
F | f | ||
) |
Definition at line 70 of file Spin.h.
References f, max, now(), success, timeout, and folly::fibers::yield().
Referenced by TEST(), folly::RelaxedConcurrentPriorityQueue< T, MayBlock, SupportsSize, PopBatch, ListTargetSize, Mutex, Atom >::tryWait(), folly::Baton< MayBlock, Atom >::tryWaitSlow(), and folly::SaturatingSemaphore< MayBlock, Atom >::tryWaitSlow().
bool folly::detail::splitFixed | ( | const Delim & | delimiter, |
StringPiece | input, | ||
OutputType & | output | ||
) |
Definition at line 343 of file String-inl.h.
References folly::Range< Iter >::find(), toOrIgnore(), UNLIKELY, value, and folly::value().
bool folly::detail::splitFixed | ( | const Delim & | delimiter, |
StringPiece | input, | ||
OutputType & | outHead, | ||
OutputTypes &... | outTail | ||
) |
Definition at line 358 of file String-inl.h.
References folly::Range< Iter >::begin(), delimSize(), folly::Range< Iter >::end(), folly::Range< Iter >::find(), LIKELY, toOrIgnore(), and UNLIKELY.
|
noexcept |
Definition at line 266 of file Conv.cpp.
References b, folly::BOOL_INVALID_VALUE, folly::BOOL_OVERFLOW, folly::EMPTY_INPUT_STRING, and folly::makeUnexpected().
Referenced by folly::toAppendStrImpl().
|
noexcept |
StringPiece to double, with progress information. Alters the StringPiece parameter to munch the already-parsed characters.
Definition at line 343 of file Conv.cpp.
References b, c, folly::EMPTY_INPUT_STRING, folly::makeUnexpected(), folly::pushmi::__adl::noexcept(), folly::size(), str_to_floating< double >(), str_to_floating< float >(), folly::STRING_TO_FLOAT_ERROR, suffix, and value.
Referenced by folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_floating(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_floating(), and folly::toAppendStrImpl().
|
noexcept |
StringPiece to integrals, with progress information. Alters the StringPiece parameter to munch the already-parsed characters.
Definition at line 683 of file Conv.cpp.
References b, folly::EMPTY_INPUT_STRING, m, folly::makeUnexpected(), folly::NO_DIGITS, folly::pushmi::__adl::noexcept(), folly::NON_DIGIT_CHAR, folly::POSITIVE_OVERFLOW, str_to_integral< char >(), str_to_integral< int >(), str_to_integral< long >(), str_to_integral< long long >(), str_to_integral< short >(), str_to_integral< signed char >(), str_to_integral< unsigned char >(), str_to_integral< unsigned int >(), str_to_integral< unsigned long >(), str_to_integral< unsigned long long >(), str_to_integral< unsigned short >(), folly::SUCCESS, type, UNLIKELY, and value.
Referenced by folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
|
noexcept |
Referenced by str_to_integral(), and folly::toAppendStrImpl().
int folly::detail::sysMembarrier | ( | ) |
Definition at line 58 of file SysMembarrier.cpp.
Referenced by folly::asymmetricHeavyBarrier().
bool folly::detail::sysMembarrierAvailable | ( | ) |
Definition at line 41 of file SysMembarrier.cpp.
References folly::kIsLinux.
Referenced by folly::asymmetricHeavyBarrier().
|
noexcept |
Definition at line 65 of file Exception.h.
References testing::Args(), FOLLY_ALWAYS_INLINE, FOLLY_ATTR_VISIBILITY_HIDDEN, and folly::throw_exception().
folly::detail::TEST_F | ( | StaticSingletonManagerTest | , |
example | |||
) |
Definition at line 29 of file StaticSingletonManagerTest.cpp.
References ASSERT_NE, EXPECT_EQ, EXPECT_NE, i, k, and folly::gen::move.
int folly::detail::tfo_enable | ( | int | sockfd, |
size_t | max_queue_size | ||
) |
Enable TFO on a listening socket.
Definition at line 113 of file SocketFastOpen.cpp.
Referenced by folly::AsyncServerSocket::setupSocket(), and TestServer::TestServer().
ssize_t folly::detail::tfo_sendmsg | ( | int | sockfd, |
const struct msghdr * | msg, | ||
int | flags | ||
) |
tfo_sendto has the same semantics as sendmsg, but is used to send with TFO data.
Definition at line 108 of file SocketFastOpen.cpp.
Referenced by folly::AsyncSocket::tfoSendMsg().
bool folly::detail::tfo_succeeded | ( | int | sockfd | ) |
Check if TFO succeeded in being used.
Definition at line 118 of file SocketFastOpen.cpp.
Referenced by folly::AsyncSocket::getTFOSucceded().
FOLLY_NOINLINE FOLLY_COLD void folly::detail::throw_exception_ | ( | Args &&... | args | ) |
Definition at line 61 of file Exception.h.
References testing::Args(), and folly::throw_exception().
TargetClock::time_point folly::detail::time_point_conv | ( | std::chrono::time_point< Clock, Duration > const & | time | ) |
Optimal when TargetClock is the same type as Clock.
Otherwise, both Clock::now() and TargetClock::now() must be invoked.
Definition at line 29 of file Futex-inl.h.
References count, futexWaitImpl(), futexWakeImpl(), max, now(), type, uint32_t, and value.
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN T&& folly::detail::to_exception_arg_ | ( | T && | t | ) |
Definition at line 52 of file Exception.h.
References folly::pushmi::detail::t, and folly::T.
Referenced by folly::terminate_with(), and folly::throw_exception().
FOLLY_ALWAYS_INLINE FOLLY_ATTR_VISIBILITY_HIDDEN char const* folly::detail::to_exception_arg_ | ( | char const (&) | array[N] | ) |
Definition at line 56 of file Exception.h.
References testing::Args(), and upload::const.
void folly::detail::toOrIgnore | ( | StringPiece | input, |
OutputType & | output | ||
) |
|
inline |
Definition at line 340 of file String-inl.h.
std::string folly::detail::toPseudoJson | ( | const folly::dynamic & | d | ) |
Definition at line 194 of file DynamicParser.cpp.
Referenced by folly::DynamicParser::reportError(), and folly::DynamicParser::required().
|
inline |
Definition at line 653 of file ExceptionWrapper.h.
References f.
Referenced by folly::try_and_catch().
|
inline |
Definition at line 658 of file ExceptionWrapper.h.
References f.
Expected<Tgt, ConversionCode> folly::detail::tryPosixTimeToDuration | ( | Seconds | seconds, |
Subseconds | subseconds | ||
) |
Definition at line 557 of file Conv.h.
References folly::makeUnexpected(), max, folly::NEGATIVE_OVERFLOW, folly::POSITIVE_OVERFLOW, type, and UNLIKELY.
size_t folly::detail::uintToBinary | ( | char * | buffer, |
size_t | bufLen, | ||
Uint | v | ||
) |
Convert an unsigned to binary.
Just like folly::detail::uintToBuffer in Conv.h, writes at the end of the supplied buffer and returns the offset of the beginning of the string from the start of the buffer. The formatted string will be in range [buf+begin, buf+bufLen).
Definition at line 142 of file Format-inl.h.
References testing::Args(), b, formatBinary, and v.
Referenced by compareBinary(), and folly::FormatValue< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value >::type >::doFormat().
size_t folly::detail::uintToHex | ( | char * | buffer, |
size_t | bufLen, | ||
Uint | v, | ||
std::array< std::array< char, 2 >, 256 > const & | repr | ||
) |
Convert an unsigned to hex, using repr (which maps from each possible 2-hex-bytes value to the 2-character representation).
Just like folly::detail::uintToBuffer in Conv.h, writes at the end of the supplied buffer and returns the offset of the beginning of the string from the start of the buffer. The formatted string will be in range [buf+begin, buf+bufLen).
Definition at line 65 of file Format-inl.h.
Referenced by uintToHexLower(), and uintToHexUpper().
|
inline |
Convert an unsigned to hex, using lower-case letters for the digits above 9. See the comments for uintToHex.
Definition at line 90 of file Format-inl.h.
References uintToHex().
Referenced by BENCHMARK_RELATIVE(), compareHex(), and folly::FormatValue< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value >::type >::doFormat().
|
inline |
Convert an unsigned to hex, using upper-case letters for the digits above 9. See the comments for uintToHex.
Definition at line 99 of file Format-inl.h.
References uintToHex().
Referenced by folly::FormatValue< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value >::type >::doFormat().
size_t folly::detail::uintToOctal | ( | char * | buffer, |
size_t | bufLen, | ||
Uint | v | ||
) |
Convert an unsigned to octal.
Just like folly::detail::uintToBuffer in Conv.h, writes at the end of the supplied buffer and returns the offset of the beginning of the string from the start of the buffer. The formatted string will be in range [buf+begin, buf+bufLen).
Definition at line 112 of file Format-inl.h.
References b, formatOctal, and v.
Referenced by BENCHMARK_RELATIVE(), compareOctal(), and folly::FormatValue< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value >::type >::doFormat().
auto folly::detail::ulock | ( | Synchronized & | synchronized, |
Args &&... | args | ||
) |
Definition at line 945 of file Synchronized.h.
References a, testing::Args(), makeSynchronizedLocker(), and s.
Referenced by folly::ulock().
void folly::detail::unsafeStringSetLargerSize | ( | std::string & | s, |
std::size_t | n | ||
) |
Referenced by folly::resizeWithoutInitialization().
void folly::detail::unsafeVectorSetLargerSize | ( | std::vector< T > & | v, |
std::size_t | n | ||
) |
Referenced by folly::resizeWithoutInitialization().
|
noexcept |
Definition at line 99 of file Iterator.h.
Referenced by folly::get_emplace_arg().
|
noexcept |
Definition at line 103 of file Iterator.h.
|
noexcept |
std::enable_if< !std::is_same< typename std::iterator_traits<Iter>::iterator_category, std::random_access_iterator_tag>::value, typename std::iterator_traits<Iter>::reference>::type folly::detail::value_before | ( | Iter | i | ) |
For all other iterators, we need to use the decrement operator.
Definition at line 136 of file Range.h.
References i.
Referenced by folly::Range< unsigned char * >::back().
auto folly::detail::wlock | ( | Synchronized & | synchronized, |
Args &&... | args | ||
) |
Definition at line 925 of file Synchronized.h.
References a, testing::Args(), makeSynchronizedLocker(), and s.
Referenced by folly::wlock().
|
inline |
Definition at line 185 of file IPAddressSource.h.
References buffer(), i, and folly::value().
Referenced by fastIpv6ToBufferUnsafe().
constexpr const char* folly::detail::xlogStripFilenameMatchFound | ( | const char * | filename, |
const char * | prefixes, | ||
size_t | prefixIdx, | ||
size_t | filenameIdx | ||
) |
Definition at line 519 of file xlog.h.
References folly::xlogIsDirSeparator(), and xlogStripFilenameRecursive().
Referenced by xlogStripFilenameRecursive().
constexpr const char * folly::detail::xlogStripFilenameRecursive | ( | const char * | filename, |
const char * | prefixes, | ||
size_t | prefixIdx, | ||
size_t | filenameIdx, | ||
bool | match | ||
) |
Definition at line 531 of file xlog.h.
References folly::xlogIsDirSeparator(), and xlogStripFilenameMatchFound().
Referenced by folly::xlogIsDirSeparator(), folly::xlogStripFilename(), and xlogStripFilenameMatchFound().
decltype(cEscapeTable) FOLLY_STORAGE_CONSTEXPR folly::detail::cEscapeTable |
Definition at line 116 of file String.cpp.
Referenced by folly::cEscape().
decltype(cUnescapeTable) FOLLY_STORAGE_CONSTEXPR folly::detail::cUnescapeTable |
Definition at line 118 of file String.cpp.
Referenced by folly::cEscape(), and folly::cUnescape().
FOLLY_STORAGE_CONSTEXPR auto folly::detail::formatAlignTable |
Definition at line 78 of file Format.cpp.
Referenced by folly::FormatArg::initSlow().
decltype(formatBinary) FOLLY_STORAGE_CONSTEXPR folly::detail::formatBinary |
Definition at line 88 of file Format.cpp.
Referenced by uintToBinary().
decltype(formatHexLower) FOLLY_STORAGE_CONSTEXPR folly::detail::formatHexLower |
Definition at line 82 of file Format.cpp.
decltype(formatHexUpper) FOLLY_STORAGE_CONSTEXPR folly::detail::formatHexUpper |
Definition at line 84 of file Format.cpp.
decltype(formatOctal) FOLLY_STORAGE_CONSTEXPR folly::detail::formatOctal |
Definition at line 86 of file Format.cpp.
Referenced by uintToOctal().
FOLLY_STORAGE_CONSTEXPR auto folly::detail::formatSignTable |
Definition at line 80 of file Format.cpp.
Referenced by folly::FormatArg::initSlow().
decltype(hexTable) FOLLY_STORAGE_CONSTEXPR folly::detail::hexTable |
Definition at line 120 of file String.cpp.
Referenced by folly::cEscape(), folly::cUnescape(), folly::MacAddress::parse(), folly::unhexlify(), and folly::uriUnescape().
constexpr auto folly::detail::is_atomic< std::atomic< Integer > > = false |
A simple trait to determine if the given type is an instantiation of std::atomic
Definition at line 67 of file AtomicUtil-inl.h.
constexpr double folly::detail::kClampCastLowerBoundDoubleToInt64F = -9223372036854774784.0 |
Definition at line 345 of file ConstexprMath.h.
Referenced by folly::constexpr_clamp_cast().
constexpr float folly::detail::kClampCastLowerBoundFloatToInt32F = -2147483520.0f |
Definition at line 349 of file ConstexprMath.h.
Referenced by folly::constexpr_clamp_cast().
constexpr double folly::detail::kClampCastUpperBoundDoubleToInt64F = 9223372036854774784.0 |
Definition at line 346 of file ConstexprMath.h.
Referenced by folly::constexpr_clamp_cast().
constexpr double folly::detail::kClampCastUpperBoundDoubleToUInt64F = 18446744073709549568.0 |
Definition at line 347 of file ConstexprMath.h.
Referenced by folly::constexpr_clamp_cast().
constexpr float folly::detail::kClampCastUpperBoundFloatToInt32F = 2147483520.0f |
Definition at line 350 of file ConstexprMath.h.
Referenced by folly::constexpr_clamp_cast().
constexpr float folly::detail::kClampCastUpperBoundFloatToUInt32F = 4294967040.0f |
Definition at line 351 of file ConstexprMath.h.
Referenced by folly::constexpr_clamp_cast().
const size_t folly::detail::kMaxBinaryLength = 8 * sizeof(uintmax_t) |
Definition at line 53 of file Format-inl.h.
Referenced by compareBinary().
const size_t folly::detail::kMaxHexLength = 2 * sizeof(uintmax_t) |
Definition at line 51 of file Format-inl.h.
Referenced by BENCHMARK_RELATIVE(), and compareHex().
const size_t folly::detail::kMaxOctalLength = 3 * sizeof(uintmax_t) |
Definition at line 52 of file Format-inl.h.
Referenced by BENCHMARK_RELATIVE(), and compareOctal().
std::array< std::array< std::uint8_t, 256 >, 8 > const folly::detail::kSelectInByte |
Definition at line 57 of file Select64.cpp.
Referenced by folly::select64(), and TEST_F().
FOLLY_PUSH_WARNING RHS folly::detail::rhs |
Definition at line 649 of file Traits.h.
Referenced by testing::internal::ArrayEq(), folly::LockedPtrBase< SynchronizedType, SynchronizedType::MutexType, LockPolicy >::assignImpl(), folly::LockedPtrBase< SynchronizedType, std::mutex, LockPolicy >::assignImpl(), BENCHMARK(), folly::BenchmarkSuspender::BenchmarkSuspender(), PreCalculatedPrimeTable::CalculatePrimesUpTo(), CheckedInt::CheckedInt(), testing::internal::CmpHelperEQ(), testing::internal::CmpHelperFloatingPointEQ(), testing::internal::RefMatcher< T & >::Impl< Super >::DescribeNegationTo(), testing::gmock_matchers_test::IsHalfOfMatcher::DescribeNegationTo(), testing::DoubleEq(), testing::DoubleNear(), folly::detail::EmulatedFutexAtomic< T >::EmulatedFutexAtomic(), folly::Synchronized< std::vector< detail::folly::detail::TypeDescriptor >, folly::SharedMutexImpl >::exchange(), testing::FloatEq(), testing::internal::FloatingPointLE(), testing::FloatNear(), folly::exception_tracer::getExceptionStatistics(), folly::hazptr_holder< Atom >::hazptr_holder(), testing::UnitTest::impl(), folly::detail::IndexedMemPoolRecycler< Pool >::IndexedMemPoolRecycler(), folly::fbstring_core< char >::isShared(), folly::LockedPtr< SynchronizedType, LockPolicy >::LockedPtr(), folly::LockedPtrBase< SynchronizedType, SynchronizedType::MutexType, LockPolicy >::LockedPtrBase(), folly::LockedPtrBase< SynchronizedType, std::mutex, LockPolicy >::LockedPtrBase(), testing::internal::BoundSecondMatcher< Tuple2Matcher, Second >::Impl< T >::MatchAndExplain(), folly::MPMCQueue< T, Atom, true >::MPMCQueue(), folly::detail::MPMCQueueBase< Derived< T, Atom, Dynamic > >::MPMCQueueBase(), testing::NanSensitiveDoubleEq(), testing::NanSensitiveDoubleNear(), testing::NanSensitiveFloatEq(), testing::NanSensitiveFloatNear(), folly::f14::MoveOnlyTestInt::operator!=(), folly::f14::Counts::operator!=(), folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::ConstIterator::operator!=(), folly::f14::Tracked< 0 >::operator!=(), folly::detail::LifoSemHead::operator!=(), testing::Expectation::operator!=(), folly::f14::GenericAlloc< T >::operator!=(), testing::ExpectationSet::operator!=(), folly::operator!=(), folly::detail::DynamicKeyEqual::operator()(), folly::detail::TransparentRangeEqualTo< detail::ValueTypeForTransparentConversionToRange< T >::type >::operator()(), folly::f14::GenericEqual< T >::operator()(), folly::AsciiCaseSensitive::operator()(), folly::AsciiCaseInsensitive::operator()(), testing::internal::LessComparator::operator()(), folly::operator+(), folly::operator<=(), folly::hazptr_holder< Atom >::operator=(), folly::f14::MoveOnlyTestInt::operator=(), folly::BenchmarkSuspender::operator=(), folly::F14VectorSet< Key, Hasher, KeyEqual, Alloc >::operator=(), folly::F14VectorMap< Key, Mapped, Hasher, KeyEqual, Alloc >::operator=(), folly::f14::Tracked< 0 >::operator=(), folly::MPMCQueue< T, Atom, true >::operator=(), folly::Synchronized< std::vector< detail::folly::detail::TypeDescriptor >, folly::SharedMutexImpl >::operator=(), folly::detail::MPMCQueueBase< Derived< T, Atom, Dynamic > >::operator=(), CheckedInt::operator=(), folly::LockedPtrBase< SynchronizedType, SynchronizedType::MutexType, LockPolicy >::operator=(), folly::LockedPtrBase< SynchronizedType, std::mutex, LockPolicy >::operator=(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::operator=(), folly::LockedPtr< SynchronizedType, LockPolicy >::operator=(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::UpgradeHolder::operator=(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WriteHolder::operator=(), folly::detail::IteratorFacade< dynamic::const_key_iterator, dynamic const , std::forward_iterator_tag >::operator==(), folly::StringKeyedMap< Value, Compare, Alloc >::operator==(), folly::StringKeyedSetBase< Compare, Alloc >::operator==(), folly::operator>=(), folly::parseLeadingNumber(), testing::Pointwise(), folly::Range< unsigned char * >::Range(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder(), testing::internal::ShouldRunTestCase(), folly::hazptr_holder< Atom >::swap(), folly::Expected< int, E >::swap(), folly::swap(), TEST(), testing::TEST(), testing::gmock_matchers_test::TEST(), folly::f14::Tracked< 0 >::Tracked(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::UpgradeHolder::UpgradeHolder(), folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WriteHolder::WriteHolder(), and folly::fibers::TimedMutex::~TimedMutex().
struct folly::detail::LastElementImpl folly::detail::sizeof |
|
static |
Definition at line 28 of file DigestBuilder-defs.h.
Referenced by folly::detail::DigestBuilder< DigestT >::append().
decltype(uriEscapeTable) FOLLY_STORAGE_CONSTEXPR folly::detail::uriEscapeTable |
Definition at line 122 of file String.cpp.
Referenced by folly::cUnescape(), and folly::uriEscape().