From 81fa50c77d7338039e63788645b18f01b9963c25 Mon Sep 17 00:00:00 2001 From: agra Date: Fri, 12 Jun 2026 21:43:19 +0300 Subject: [PATCH] fix: std.http dealloc_bytes calls match the Allocator protocol arity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The protocol declares dealloc_bytes(ptr) — the size argument I passed at three sites was silently accepted and dropped by the compiler (issue 0131); these calls would stop compiling the moment that diagnostic gap is fixed. --- library/modules/std/http.sx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/modules/std/http.sx b/library/modules/std/http.sx index 055397f..77923bb 100644 --- a/library/modules/std/http.sx +++ b/library/modules/std/http.sx @@ -220,7 +220,7 @@ Server :: struct { socket.close(c.fd); } if c.out_buf != null { - self.own_alloc.dealloc_bytes(xx c.out_buf, c.out_len); + self.own_alloc.dealloc_bytes(xx c.out_buf); c.out_buf = null; } // read_buf stays allocated — reused by the next connection here. @@ -332,7 +332,7 @@ Server :: struct { if want <= c.read_cap { return false; } // already at the limit nb : [*]u8 = xx self.own_alloc.alloc_bytes(want); if c.read_len > 0 { memcpy(nb, c.read_buf, xx c.read_len); } - self.own_alloc.dealloc_bytes(xx c.read_buf, c.read_cap); + self.own_alloc.dealloc_bytes(xx c.read_buf); c.read_buf = nb; c.read_cap = want; return true; @@ -516,7 +516,7 @@ Server :: struct { self.loop.del_write(c.fd); c.write_armed = false; } - self.own_alloc.dealloc_bytes(xx c.out_buf, c.out_len); + self.own_alloc.dealloc_bytes(xx c.out_buf); c.out_buf = null; c.out_len = 0; c.out_sent = 0;