hs_alloc_t

Type Alias 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.

Aliased Type§

pub enum hs_alloc_t {
    None,
    Some(unsafe extern "C" fn(usize) -> *mut c_void),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(usize) -> *mut c_void)

Some value of type T.