silc_stack_alloc

SYNOPSIS

    SilcStack silc_stack_alloc(SilcUInt32 stack_size, SilcStack parent);

DESCRIPTION

Allocates new data stack that can be used as stack for fast memory allocation by various routines. Returns the pointer to the stack that must be freed with silc_stack_free function when it is not needed anymore. If the `stack_size' is zero (0) by default a 1 kilobyte (1024 bytes) stack is allocated.

If `parent' is non-NULL the created stack is a child of the `parent' stack. All of childs the memory is allocated from the `parent' and will be returned back to the parent when the child is freed. Note that, even though child allocates memory from the parent, the parent's stack is not consumed.

Returns NULL on error and sets silc_errno.