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 that must be freed b...
static void freeMemory(void *ptr)
Free function to be used instead of free if code is written that 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 that must be freed by the ca...
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...
A custom delete that can be used in std::unique_ptr and std::shared_ptr.
void operator()(void *p) const