Azure Kinect Sensor SDK  refs/heads/master
Documentation for https://github.com/Microsoft/Azure-Kinect-Sensor-SDK

◆ k4a_set_allocator()

k4a_result_t k4a_set_allocator ( k4a_memory_allocate_cb_t  allocate,
k4a_memory_destroy_cb_t  free 
)

Sets the callback functions for the SDK allocator.

Parameters
allocateThe callback function to allocate memory. When the SDK requires memory allocation this callback will be called and the application can provide a buffer and a context.
freeThe callback function to free memory. The SDK will call this function when memory allocated by allocate is no longer needed.
Returns
K4A_RESULT_SUCCEEDED if the callback function was set or cleared successfully. K4A_RESULT_FAILED if an error is encountered or the callback function has already been set.
Remarks
Call this function to hook memory allocation by the SDK. Calling with both allocate and free as NULL will clear the hook and reset to the default allocator.
If this function is called after memory has been allocated, the previous version of free function may still be called in the future. The SDK will always call the free function that was set at the time that the memory was allocated.
Not all memory allocation by the SDK is performed by this allocate function. Small allocations or allocations from special pools may come from other sources.