Skip to main content

drvector_init

Function drvector_init 

Source
pub unsafe extern "C" fn drvector_init(
    vec: *mut drvector_t,
    initial_capacity: uint,
    synch: bool_,
    free_data_func: Option<unsafe extern "C" fn(arg1: *mut c_void)>,
) -> bool_
Expand description

Initializes a drvector with the given parameters

@param[out] vec The vector to be initialized. @param[in] initial_capacity The initial number of entries allocated for the vector. @param[in] synch Whether to synchronize each operation. Even when \p synch is false, the vector’s lock is initialized and can be used via vector_lock() and vector_unlock(), allowing the caller to extend synchronization beyond just the operation in question, to include accessing a looked-up payload, e.g. @param[in] free_data_func A callback for freeing each data item. Leave it NULL if no callback is needed.