Function hyperscan_sys::hs_set_stream_allocator[][src]

pub unsafe extern "C" fn hs_set_stream_allocator(
    alloc_func: hs_alloc_t,
    free_func: hs_free_t
) -> hs_error_t
Expand description

Set the allocate and free functions used by Hyperscan for allocating memory for stream state by @ref hs_open_stream().

If no stream allocation functions are set, or if NULL is used in place of both parameters, then memory allocation will default to standard methods (such as the system malloc() and free() calls).

This call will override any previous stream allocators that have been set.

Note: the stream allocator may also be set by calling @ref hs_set_allocator().

@param alloc_func A callback function pointer that allocates memory. This function must return memory suitably aligned for the largest representable data type on this platform.

@param free_func A callback function pointer that frees allocated memory.

@return @ref HS_SUCCESS on success, other values on failure.