aboutsummaryrefslogtreecommitdiff
path: root/linked_list.inc
diff options
context:
space:
mode:
Diffstat (limited to 'linked_list.inc')
-rw-r--r--linked_list.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/linked_list.inc b/linked_list.inc
index 0e5042b..6e0e0e4 100644
--- a/linked_list.inc
+++ b/linked_list.inc
@@ -99,4 +99,20 @@ _dll_end:
mov qword [rax + dll_prev], %1
%endm
+_dll_free:
+ push rbp
+ mov rbp, rsp
+ push rbx
+
+ dll_end
+.free_loop:
+ mov rbx, [rax + dll_prev]
+ dll_free
+ mov rax, rbx
+ cmp rbx, 0
+ jne .free_loop
+ pop rbx
+ mov rsp, rbp
+ pop rbp
+ ret
%endif