Override the functions that Libevent uses for memory management.
Usually, Libevent uses the standard libc functions malloc, realloc, and
free to allocate memory. Passing replacements for those functions to
event_set_mem_functions() overrides this behavior.
Note that all memory returned from Libevent will be allocated by the
replacement functions rather than by malloc() and realloc(). Thus, if you
have replaced those functions, it will not be appropriate to free() memory
that you get from Libevent. Instead, you must use the free_fn replacement
that you provided.
Note also that if you are going to call this function, you should do so
before any call to any Libevent function that does allocation.
Otherwise, those funtions will allocate their memory using malloc(), but
then later free it using your provided free_fn.
@param malloc_fn A replacement for malloc.
@param realloc_fn A replacement for realloc
@param free_fn A replacement for free.
Override the functions that Libevent uses for memory management.
Usually, Libevent uses the standard libc functions malloc, realloc, and free to allocate memory. Passing replacements for those functions to event_set_mem_functions() overrides this behavior.
Note that all memory returned from Libevent will be allocated by the replacement functions rather than by malloc() and realloc(). Thus, if you have replaced those functions, it will not be appropriate to free() memory that you get from Libevent. Instead, you must use the free_fn replacement that you provided.
Note also that if you are going to call this function, you should do so before any call to any Libevent function that does allocation. Otherwise, those funtions will allocate their memory using malloc(), but then later free it using your provided free_fn.
@param malloc_fn A replacement for malloc. @param realloc_fn A replacement for realloc @param free_fn A replacement for free.