Function TVMFFISetCustomAllocator

Function TVMFFISetCustomAllocator#

Function Documentation#

int TVMFFISetCustomAllocator(TVMFFICustomAllocator *allocator)#

Register the process-wide custom allocator.

Note

allocator must be alive throughout the lifetime of the process.

Note

Not synchronized against concurrent TVMFFIGetCustomAllocator or object creation. Install the allocator once during single-threaded frontend initialization, before any object of a custom-allocated type crosses into the frontend.

Parameters:

allocator – Pointer to a TVMFFICustomAllocator, or NULL to restore the builtin default.

Returns:

0 on success, nonzero on failure.