This commit is contained in:
nub31
2025-06-15 01:47:10 +02:00
parent 7c05870e24
commit 3f7499d2b9
10 changed files with 63 additions and 50 deletions

View File

@@ -1,7 +1,6 @@
.intel_syntax noprefix
.equ SYS_MMAP, 9
.equ SYS_MUNMAP, 11
.text
.globl nub_strlen
@@ -79,22 +78,3 @@ function_exit:
pop r12
pop rbx
ret
.text
.globl nub_string_free
# func nub_string_free(string: []u8): void
nub_string_free:
test rdi, rdi
jz free_exit
mov rsi, [rdi]
add rsi, 8
# Round up to page size
add rsi, 4095
and rsi, -4096
mov rax, SYS_MUNMAP
syscall
free_exit:
ret