|
void | zeromem (void *memory, size_t numBytes) noexcept |
| Fills a block of memory with zeros.
|
|
template<typename Type> |
void | zerostruct (Type &structure) noexcept |
| Overwrites a structure or object with zeros.
|
|
template<typename Type> |
void | deleteAndZero (Type &pointer) |
| Delete an object pointer, and sets the pointer to null.
|
|
template<typename Type, typename IntegerType> |
Type * | addBytesToPointer (Type *basePointer, IntegerType bytes) noexcept |
| A handy function which adds a number of bytes to any type of pointer and returns the result.
|
|
template<typename Type, typename IntegerType> |
Type * | snapPointerToAlignment (Type *basePointer, IntegerType alignmentBytes) noexcept |
| A handy function to round up a pointer to the nearest multiple of a given number of bytes.
|
|
template<typename Type1, typename Type2> |
int | getAddressDifference (Type1 *pointer1, Type2 *pointer2) noexcept |
| A handy function which returns the difference between any two pointers, in bytes.
|
|
template<class Type> |
Type * | createCopyIfNotNull (const Type *objectToCopy) |
| If a pointer is non-null, this returns a new copy of the object that it points to, or safely returns nullptr if the pointer is null.
|
|
template<typename Type> |
Type | readUnaligned (const void *srcPtr) noexcept |
| A handy function to read un-aligned memory without a performance penalty or bus-error.
|
|
template<typename Type> |
void | writeUnaligned (void *dstPtr, Type value) noexcept |
| A handy function to write un-aligned memory without a performance penalty or bus-error.
|
|