 |
PK_MEMORY_register_callbacks |
|
PK_ERROR_code_t PK_MEMORY_register_callbacks
(
--- received arguments ---
PK_MEMORY_frustrum_t frustrum --- application's memory handlers
)
This function registers memory allocation and free functions for Parasolid
to use when returning variable length information.
Specific Errors:
PK_ERROR_memory_not_empty Data is in process of being returned
This function may be called whenever Parasolid's internal PK memory is empty.
The alloc and free functions are allowed to longjump out of Parasolid in case
of an error, with the same restrictions and requirements as the user registered
error handling function. Otherwise the allocator must return NULL in the event
of an error.
If this function has not been called, or either of the function pointers
given is NULL, Parasolid will default to using the appropriate function
from the standard C run-time-library. The application should ensure that
the two functions thus registered are compatible.
The alloc and free functions registered with this function are used session-
wide, and may be called by any application thread that has not registered
thread-specific alloc and free functions with PK_THREAD_register_memory_cbs.
Thread-specific functions are used in preference to session-wide functions,
but only by the threads that have registered them.
If multiple application threads are used to call Parasolid, any registered
session-wide alloc and free functions must be thread-safe, since it will be
possible for either of them to be called simultaneously from two different
threads.