/** * 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; }
void mark_stack(void) { stack_for_each(stack_root, stack_visitor); }