feat: Removed allocations from bind and connect.

This commit is contained in:
2026-07-08 16:45:57 -04:00
parent 3c82aee01b
commit fb6581345e
2 changed files with 37 additions and 6 deletions
+4 -6
View File
@@ -125,14 +125,12 @@ close :: proc(s: Socket) -> Error {
return _close(s) == 0 ? nil : last_error()
}
bind :: proc(s: Socket, addr: string, allocator := context.temp_allocator) -> Error {
c := strings.clone_to_cstring(addr, allocator)
return _bind(s, c) == 0 ? nil : last_error()
bind :: proc(s: Socket, addr: cstring) -> Error {
return _bind(s, addr) == 0 ? nil : last_error()
}
connect :: proc(s: Socket, addr: string, allocator := context.temp_allocator) -> Error {
c := strings.clone_to_cstring(addr, allocator)
return _connect(s, c) == 0 ? nil : last_error()
connect :: proc(s: Socket, addr: cstring) -> Error {
return _connect(s, addr) == 0 ? nil : last_error()
}
send :: proc {