Exemplo n.º 1
0
/**
 * Find the number of elements on a given stack
 *
 * @v stack	Pointer to the struct stack
 * @ret size	Number of elements on the stack
 */
int stack_size ( struct stack *stack ) {
    struct stack_element *cur;
    int size = 0;
    stack_for_each ( cur, stack )
    size++;
    return size;
}
Exemplo n.º 2
0
void mark_stack(void) {
    stack_for_each(stack_root, stack_visitor);
}