|
#define | FFL_PMR std::pmr |
| In MSVC pmr was already shipped.
|
|
#define | FFL_UNALIGNED __unaligned |
| On vc use __unaligned keyword to signify that pointer is pointing to a not properly aligned data. __unaligned is not supported on x86.
|
|
#define | FFL_PLATFORM_FAIL_FAST(EC) {__debugbreak();__fastfail(EC);} |
| In MSVC define to intrinsics that terminate the process.
|
|
#define | FFL_ALLIGNED_ALLOC(BYTES, ALIGNMENT) _aligned_malloc(BYTES, ALIGNMENT) |
| In MSVC define to function that allocates aligned buffer.
|
|
#define | FFL_ALLIGNED_FREE(PTR) _aligned_free(PTR) |
| In MSVC define to function matching to _aligned_malloc.
|
|
#define | FFL_FAST_FAIL(EC) {FFL_PLATFORM_FAIL_FAST(EC);} |
| Fail fast with error code. More...
|
|
#define | FFL_CRASH_APPLICATION() FFL_FAST_FAIL(ENOTRECOVERABLE) |
| Fail fast with error ENOTRECOVERABLE(127 or 0x7f)
|
|
#define | FFL_CODDING_ERROR_IF(C) if (C) {FFL_FAST_FAIL(ENOTRECOVERABLE);} else {;} |
| If expression is true then fail fast with error ENOTRECOVERABLE(127 or 0x7f) More...
|
|
#define | FFL_CODDING_ERROR_IF_NOT(C) if (C) {;} else {FFL_FAST_FAIL(ENOTRECOVERABLE);} |
| If expression is false then fail fast with error ENOTRECOVERABLE(127 or 0x7f) More...
|
|
#define | FFL_FIELD_OFFSET(T, F) (((char const *)(&((T *)nullptr)->F)) - (char const *)nullptr) |
| Field offset in the structure. More...
|
|
#define | FFL_SIZE_THROUGH_FIELD(T, F) (FFL_FIELD_OFFSET(T, F) + sizeof(((T *)nullptr)->F)) |
| Field offset in the structure plus field size. Offset to the start of padding [if any] for the next field [if any]. More...
|
|
#define | FFL_PADDING_OFFSET_AFTER_FIELD(T, F) FFL_SIZE_THROUGH_FIELD(T, F) |
| Offset to the start of padding [if any] for the next field [if any]. More...
|
|
#define | FFL_PADDING_BETWEEN_FIELDS_UNSAFE(T, F1, F2) (FFL_FIELD_OFFSET(T, F2) - FFL_SIZE_THROUGH_FIELD(T, F1)) |
| Size of padding [if any] between two fields. Does not validate that F2 is following after F1 in the structure. More...
|
|
#define | FFL_PADDING_BETWEEN_FIELDS(T, F1, F2) ([] {static_assert(FFL_FIELD_OFFSET(T, F1) <= FFL_FIELD_OFFSET(T, F2), "F1 must have lower offset in structure than F2"); }, FFL_PADDING_BETWEEN_FIELDS_UNSAFE(T, F1, F2)) |
| Size of padding [if any] between two fields. Validate that F2 is following after F1 in the structure. More...
|
|
#define | FFL_FIELD_PTR_TO_OBJ_PTR(T, F, P) ((T *)((char const *)(P) - FFL_FIELD_OFFSET(T, F))) |
| Calculates pointer to the beginning of the structure from the pointer to a field in that structure. More...
|
|
|
template<typename T > |
constexpr void | iffl::unused_variable ([[maybe_unused]] T const &) |
| Restore saved min and max definition. More...
|
|
template<typename T > |
constexpr void | iffl::unused_expression_result ([[maybe_unused]] T const &) |
| Silence sensitizers warning about unused result of expression. More...
|
|
size_t const | iffl::ptr_to_size (void const *const ptr) |
| Reinterprets pointer to void value as size_t value. More...
|
|
void *const | iffl::size_to_ptr (size_t size) |
| Reinterprets size_t value as pointer to void. More...
|
|
constexpr size_t | iffl::roundup_size_to_alignment (size_t size, size_t alignment) noexcept |
| Rounds up size to specified alignment. More...
|
|
template<typename T > |
constexpr size_t | iffl::roundup_size_to_alignment (size_t size) noexcept |
| Rounds up size to specified alignment. More...
|
|
void * | iffl::roundup_ptr_to_alignment (void *ptr, size_t alignment) noexcept |
| Rounds up pointer to specified alignment. More...
|
|
template<typename T > |
void * | iffl::roundup_ptr_to_alignment (void *ptr) noexcept |
| Rounds up pointer to specified alignment. More...
|
|
void const * | iffl::roundup_ptr_to_alignment (void const *ptr, size_t alignment) noexcept |
| Rounds up pointer to specified alignment. More...
|
|
template<typename T > |
void const * | iffl::roundup_ptr_to_alignment (void const *ptr) noexcept |
| Rounds up pointer to specified alignment. More...
|
|
void | iffl::copy_data (char *to_buffer, char const *from_buffer, size_t length) noexcept |
| copies length bytes from from_buffer to to_buffer. source and destination buffers cannot overlap More...
|
|
void | iffl::move_data (char *to_buffer, char const *from_buffer, size_t length) noexcept |
| copies length bytes from from_buffer to to_buffer. source and destination buffers can overlap More...
|
|
void | iffl::fill_buffer (char *buffer, int value, size_t length) noexcept |
| sets "length" consecutive bytes of "to_buffer" to "value". More...
|
|
void | iffl::zero_buffer (char *buffer, size_t length) noexcept |
| sets "length" consecutive bytes of "to_buffer" to 0. More...
|
|
size_t | iffl::distance (void const *begin, void const *end) noexcept |
| sets "length" consecutive bytes of "to_buffer" to 0. More...
|
|
template<typename T > |
char * | iffl::cast_to_char_ptr (T *p) noexcept |
| Helper method to cast a pointer to a char *. More...
|
|
template<typename T > |
void * | iffl::cast_to_void_ptr (T *p) noexcept |
| Helper method to cast a pointer to a void *. More...
|
|
template<typename G > |
constexpr auto | iffl::make_scope_guard (G &&g) |
| Factory method for scoped_guard. More...
|
|
Common definitions, utility functions and vocabulary types.
- Author
- Vladimir Petter
iffl github