r6.1.1:lfds611_freelist_guaranteed_pop

From liblfds.org
Jump to navigation Jump to search

Source Files

/liblfds611/src/lfds611_freelist/lfds611_freelist_pop_push.c
/liblfds611/inc/liblfds611.h

Prototype

struct lfds611_freelist_element *lfds611_freelist_guaranteed_pop( struct lfds611_freelist_state *fs, struct lfds611_freelist_element **fe );

Parameters

struct lfds611_freelist_state *fs

A freelist state as allocated by lfds611_freelist_new.

struct lfds611_freelist_element **fe

A pointer to a freelist element pointer which will be set to point to a freshly allocated struct freelist. Set to NULL if allocation fails.

Return Value

Returns a pointer to the address of the freelist element (e.g. the value *fe is set to). Returns NULL if element creation failed. This element is actually allocated, rather than being taken from the freelist, and so will always succeed, unless malloc or the user initialisation function fail. The user initialisation function used is that which was passed to lfds611_freelist_new when the freelist was instantiated.

Notes

To obtain the user data void pointer from the element, use lfds611_freelist_get_user_data_from_element.

See Also