Custom memory allocator & error handler¶
Custom memory allocator¶
By default, the Instant Terra API will use its own memory allocator, but you can use a custom one.
To do so, your memory allocator has to inherit from the abstract class
MemoryAllocator
, and defines
the following methods:
Then, you have to call the function InstantTerraApi::SetMemoryAllocator()
to tell the API to use the custom memory allocator.
Warning
This function must be called before calling the InstantTerraApi::Init()
function!
Custom error handler¶
By default, the Instant Terra API will throws error, but you can use a custom error handler.
To do so, your error handler has to inherit from the abstract class
ErrorHandler
, and defines
the method OnError
.
Then, you have to call the function InstantTerraApi::SetErrorHandler()
to tell the API to use the custom handler.