proxygen
Bits.h File Reference
#include <cassert>
#include <cinttypes>
#include <cstdint>
#include <cstring>
#include <limits>
#include <type_traits>
#include <folly/ConstexprMath.h>
#include <folly/Portability.h>
#include <folly/Utility.h>
#include <folly/lang/Assume.h>
#include <folly/portability/Builtins.h>

Go to the source code of this file.

Classes

struct  folly::detail::uint_types_by_size< Size >
 
struct  folly::detail::uint_types_by_size< 8/8 >
 
struct  folly::detail::uint_types_by_size< 64/8 >
 
struct  folly::detail::uint_types_by_size< 32/8 >
 
struct  folly::detail::uint_types_by_size< 16/8 >
 
struct  folly::detail::EndianInt< T >
 
class  folly::Endian
 
struct  folly::Unaligned< T, Enable >
 
struct  folly::Unaligned< T, typename std::enable_if< std::is_pod< T >::value >::type >
 

Namespaces

 folly
 —— Concurrent Priority Queue Implementation ——
 
 folly::detail
 

Macros

#define FB_GEN(sz, fn)
 
#define FB_GEN1(fn, t, sz)
 
#define FB_GEN2(t, sz)
 
#define FB_GEN(sz)
 

Functions

template<typename Dst , typename Src >
constexpr std::make_signed_t< Dst > folly::detail::bits_to_signed (Src const s)
 
template<typename Dst , typename Src >
constexpr std::make_unsigned_t< Dst > folly::detail::bits_to_unsigned (Src const s)
 
template<typename T >
constexpr unsigned int folly::findFirstSet (T const v)
 
template<typename T >
constexpr unsigned int folly::findLastSet (T const v)
 
template<typename T >
constexpr unsigned int folly::popcount (T const v)
 
template<class T >
constexpr T folly::nextPowTwo (T const v)
 
template<class T >
constexpr T folly::prevPowTwo (T const v)
 
template<class T >
constexpr bool folly::isPowTwo (T const v)
 
static uint8_t folly::detail::byteswap_gen (uint8_t v)
 
static uint64_t folly::detail::byteswap_gen (uint64_t v)
 
static uint32_t folly::detail::byteswap_gen (uint32_t v)
 
static uint16_t folly::detail::byteswap_gen (uint16_t v)
 
template<class T >
FOLLY_PACK_POP T folly::loadUnaligned (const void *p)
 
template<class T >
T folly::partialLoadUnaligned (const void *p, size_t l)
 
template<class T >
void folly::storeUnaligned (void *p, T value)
 
template<typename T >
T folly::bitReverse (T n)
 

Variables

FOLLY_PACK_PUSH struct folly::Unaligned< T, typename std::enable_if< std::is_pod< T >::value >::typefolly::FOLLY_PACK_ATTR
 

Macro Definition Documentation

#define FB_GEN (   sz,
  fn 
)
Value:
static inline uint##sz##_t byteswap_gen(uint##sz##_t v) { \
return fn(v); \
} \
template <> \
struct uint_types_by_size<sz / 8> { \
using type = uint##sz##_t; \
};
static uint16_t byteswap_gen(uint16_t v)
Definition: Bits.h:193
PskType type
typename T::type _t
Definition: Traits.h:171

Definition at line 241 of file Bits.h.

#define FB_GEN (   sz)
Value:
FB_GEN2(uint##sz##_t, sz) \
FB_GEN2(int##sz##_t, sz)
#define FB_GEN2(t, sz)
Definition: Bits.h:236
typename T::type _t
Definition: Traits.h:171

Definition at line 241 of file Bits.h.

#define FB_GEN1 (   fn,
  t,
  sz 
)
Value:
static t fn##sz(t x) { \
return fn<t>(x); \
}
Definition: InvokeTest.cpp:58
const int x

Definition at line 231 of file Bits.h.

#define FB_GEN2 (   t,
  sz 
)
Value:
FB_GEN1(swap, t, sz) \
FB_GEN1(big, t, sz) \
FB_GEN1(little, t, sz)
#define FB_GEN1(fn, t, sz)
Definition: Bits.h:231
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414

Definition at line 236 of file Bits.h.