Type Definition hyperscan_sys::hs_alloc_t

source ·
pub type hs_alloc_t = Option<unsafe extern "C" fn(size: usize) -> *mut c_void>;
Expand description

The type of the callback function that will be used by Hyperscan to allocate more memory at runtime as required, for example in @ref hs_open_stream() to allocate stream state.

If Hyperscan is to be used in a multi-threaded, or similarly concurrent environment, the allocation function will need to be re-entrant, or similarly safe for concurrent use.

@param size The number of bytes to allocate. @return A pointer to the region of memory allocated, or NULL on error.