Basic memory management class for the ML.
static void * duplicateMemory(const void *ptr, MLuint numBytes, MLMemoryErrorHandling handleFailure)
Copies the memory pointed to by ptr of size numBytes in a newly allocated buffer which must be freed ...
static void freeMemory(void *ptr)
Free function to be use instead of free if code is written which uses/bases on the ML.
static void * allocateMemory(MLuint numBytes, MLMemoryErrorHandling handleFailure)
Allocates a memory block of numByts.
static void * reallocateMemory(void *ptr, MLuint numBytes, MLMemoryErrorHandling handleFailure)
The memory block pointed to by ptr is resized and copied so that it has at least numBytes.
static char * duplicateString(const char *str, MLMemoryErrorHandling handleFailure)
Copies the passed null terminated string str in a newly allocated buffer which must be freed by the c...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLMemoryErrorHandling
Enumerator to specify memory error handling.
MLuint64 MLuint
An unsigned ML integer type with at least 64 bits used for index calculations on very large images ev...
#define ML_UTILS_EXPORT
Defines platform dependent DLL export macro for mlUtils.
A custom delete which can be used in std::unique_ptr and std::shared_ptr.
void operator()(void *p) const