...
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user