Set functions to be used for allocating and freeing memory.
By default, LibJWT uses malloc, realloc, and free for memory
management. This function allows the user of the library to
specify its own memory management functions. This is especially
useful on Windows where mismatches in runtimes across DLLs can
cause problems.
The caller can specify either a valid function pointer for
any of the parameters or NULL to use the corresponding default
allocator function.
Note that this function will also set the memory allocator
for the Jansson library.
@param pmalloc The function to use for allocating memory or
NULL to use malloc
@param prealloc The function to use for reallocating memory or
NULL to use realloc
@param pfree The function to use for freeing memory or
NULL to use free
@returns 0 on success or errno otherwise.
Set functions to be used for allocating and freeing memory.
By default, LibJWT uses malloc, realloc, and free for memory management. This function allows the user of the library to specify its own memory management functions. This is especially useful on Windows where mismatches in runtimes across DLLs can cause problems.
The caller can specify either a valid function pointer for any of the parameters or NULL to use the corresponding default allocator function.
Note that this function will also set the memory allocator for the Jansson library.
@param pmalloc The function to use for allocating memory or NULL to use malloc @param prealloc The function to use for reallocating memory or NULL to use realloc @param pfree The function to use for freeing memory or NULL to use free @returns 0 on success or errno otherwise.