Hcs.Server.Conn_buffers

hcs · API reference

Per-connection scratch, reused across connections. buf/cs are the read buffer: the http codecs read from a bigstring (Http_core.Bigstring.t), and Eio reads the socket into a bigarray-backed Cstruct over that buffer, so the socket→codec hop is zero-copy. wscratch is the write scratch: small Bytes iovecs (frame heads, Fixed string bodies) are blitted into it for the vectored write instead of mallocing a fresh Cstruct each. Lock-free Treiber stack via Kcas.

type t = {
  buf : Http_core.Bigstring.t;
  cs : Cstruct.t;
  mutable wscratch : Cstruct.t;
}
val acquire : unit -> t
val release : t -> unit