|
template<typename T > |
static T | Minimum (T x, T y) |
|
template<typename T > |
static constexpr T | Maximum (T x, T y) |
|
template<typename T > |
static T | Abs (T x) |
|
template<typename T > |
static T | AbsWithSaturation (T x) |
|
template<typename T > |
static constexpr bool | IsPowerOfTwo (T x) |
|
template<typename T > |
static constexpr int | ShiftForPowerOfTwo (T x) |
|
template<typename T > |
static constexpr bool | IsAligned (T x, uintptr_t alignment, uintptr_t offset=0) |
|
template<typename T > |
static constexpr bool | IsAligned (T *x, uintptr_t alignment, uintptr_t offset=0) |
|
template<typename T > |
static constexpr T | RoundDown (T x, intptr_t alignment) |
|
template<typename T > |
static T * | RoundDown (T *x, intptr_t alignment) |
|
template<typename T > |
static constexpr T | RoundUp (T x, uintptr_t alignment, uintptr_t offset=0) |
|
template<typename T > |
static T * | RoundUp (T *x, uintptr_t alignment, uintptr_t offset=0) |
|
static constexpr uintptr_t | RoundUpToPowerOfTwo (uintptr_t x) |
|
static constexpr int | CountOneBits64 (uint64_t x) |
|
static constexpr int | CountOneBits32 (uint32_t x) |
|
static constexpr int | CountOneBitsWord (uword x) |
|
static constexpr size_t | HighestBit (int64_t v) |
|
static constexpr size_t | BitLength (int64_t value) |
|
static int | CountLeadingZeros32 (uint32_t x) |
|
static int | CountLeadingZeros64 (uint64_t x) |
|
static int | CountLeadingZerosWord (uword x) |
|
static int | CountTrailingZeros32 (uint32_t x) |
|
static int | CountTrailingZeros64 (uint64_t x) |
|
static int | CountTrailingZerosWord (uword x) |
|
static uint64_t | ReverseBits64 (uint64_t x) |
|
static uint32_t | ReverseBits32 (uint32_t x) |
|
static uword | ReverseBitsWord (uword x) |
|
static void | CalculateMagicAndShiftForDivRem (int64_t divisor, int64_t *magic, int64_t *shift) |
|
static uint32_t | StringHash (const void *data, int length) |
|
static uint32_t | WordHash (intptr_t key) |
|
template<typename T > |
static bool | IsInt (intptr_t N, T value) |
|
template<typename T > |
static bool | IsUint (intptr_t N, T value) |
|
template<typename T > |
static bool | MagnitudeIsUint (intptr_t N, T value) |
|
static int32_t | Low16Bits (int32_t value) |
|
static int32_t | High16Bits (int32_t value) |
|
static int32_t | Low32Bits (int64_t value) |
|
static int32_t | High32Bits (int64_t value) |
|
static int64_t | LowHighTo64Bits (uint32_t low, int32_t high) |
|
static constexpr bool | IsAlphaNumeric (uint32_t c) |
|
static constexpr bool | IsDecimalDigit (uint32_t c) |
|
static bool | IsHexDigit (char c) |
|
static int | HexDigitToInt (char c) |
|
static char | IntToHexDigit (int i) |
|
static bool | RangeCheck (intptr_t offset, intptr_t count, intptr_t length) |
|
static bool | WillAddOverflow (int64_t a, int64_t b) |
|
static bool | WillSubOverflow (int64_t a, int64_t b) |
|
template<typename T = int64_t> |
static T | AddWithWrapAround (T a, T b) |
|
template<typename T = int64_t> |
static T | SubWithWrapAround (T a, T b) |
|
template<typename T = int64_t> |
static T | MulWithWrapAround (T a, T b) |
|
template<typename T = int64_t> |
static T | NegWithWrapAround (T a) |
|
static int64_t | ShiftLeftWithTruncation (int64_t a, int64_t b) |
|
template<typename T > |
static T | RotateLeft (T value, uint8_t rotate) |
|
template<typename T > |
static T | RotateRight (T value, uint8_t rotate) |
|
static float | DivideAllowZero (float a, float b) |
|
static double | DivideAllowZero (double a, double b) |
|
static uint16_t | HostToBigEndian16 (uint16_t host_value) |
|
static uint32_t | HostToBigEndian32 (uint32_t host_value) |
|
static uint64_t | HostToBigEndian64 (uint64_t host_value) |
|
static uint16_t | HostToLittleEndian16 (uint16_t host_value) |
|
static uint32_t | HostToLittleEndian32 (uint32_t host_value) |
|
static uint64_t | HostToLittleEndian64 (uint64_t host_value) |
|
static uint32_t | BigEndianToHost32 (uint32_t be_value) |
|
static uint64_t | LittleEndianToHost64 (uint64_t le_value) |
|
static bool | DoublesBitEqual (const double a, const double b) |
|
template<typename T > |
static T | SafeDoubleToInt (double v) |
|
static bool | IsJavaScriptInt (int64_t value) |
|
template<typename T = uword> |
static constexpr T | NBitMask (size_t n) |
|
template<typename T = uword> |
static constexpr T | Bit (size_t n) |
|
template<typename T > |
static constexpr bool | TestBit (T mask, size_t position) |
|
static char * | StrError (int err, char *buffer, size_t bufsize) |
|
static char * | StrNDup (const char *s, intptr_t n) |
|
static char * | StrDup (const char *s) |
|
static intptr_t | StrNLen (const char *s, intptr_t n) |
|
static bool | StrStartsWith (const char *s, const char *prefix) |
|
static int | Close (int fildes) |
|
static size_t | Read (int filedes, void *buf, size_t nbyte) |
|
static int | Unlink (const char *path) |
|
static int | SNPrint (char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3 |
|
static int static int | VSNPrint (char *str, size_t size, const char *format, va_list args) |
|
static char * | SCreate (const char *format,...) PRINTF_ATTRIBUTE(1 |
|
static char static char * | VSCreate (const char *format, va_list args) |
|
static void * | LoadDynamicLibrary (const char *library_path, char **error=nullptr) |
|
static void * | ResolveSymbolInDynamicLibrary (void *library_handle, const char *symbol, char **error=nullptr) |
|
static void | UnloadDynamicLibrary (void *library_handle, char **error=nullptr) |
|
Definition at line 33 of file utils.h.