aboutsummaryrefslogtreecommitdiff
path: root/libc/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stack.c')
-rw-r--r--libc/stack.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/stack.c b/libc/stack.c
index dac18a2..c47dd59 100644
--- a/libc/stack.c
+++ b/libc/stack.c
@@ -117,3 +117,9 @@ void *stack_peek(struct stack *stack)
return stack->tail;
}
+
+void stack_clear(struct stack *stack)
+{
+ while (stack_pop(stack))
+ ;
+}