r6.1.0:lfds610_stack_new
Jump to navigation
Jump to search
Source Files
/liblfds610/src/lfds610_stack/lfds610_stack_new.c /liblfds610/inc/liblfds610.h
Prototype
int lfds610_stack_new( struct lfds610_stack_state **ss, lfds610_atom_t number_elements );
Parameters
struct lfds610_stack_state **ss
- A pointer to a pointer onto which is allocated the state which represents this stack. Set to NULL if stack creation fails.
lfds610_atom_t number_elements
- The maximum number of elements which can be present in the stack. These elements will be allocated when the stack is created. If not all elements could be allocated (malloc() fails), stack creation fails.
Return Value
Returns 1 on success and 0 on failure, with *ss being set to NULL on failure.
Notes
This function instantiates a stack. After instantiation any thread (except the instantiating thread) must before using the stack first call lfds610_stack_use.