Module Trace_fuchsia.Buf_chain

A set of buffers in use, and a set of ready buffers

type buffers =
  1. | B_one of {
    1. mutable buf : Buf.t;
    }

Buffers in use

type t = {
  1. bufs : buffers;
  2. has_ready : bool Trace_fuchsia__.Common_.A.t;
  3. ready : Buf.t Stdlib.Queue.t Trace_fuchsia__.Lock.t;
    (*

    Buffers that are full (enough) and must be written

    *)
  4. buf_pool : Buf_pool.t;
}

A set of buffers, some of which are ready to be written

val create : sharded:bool -> buf_pool:Buf_pool.t -> unit -> t
val ready_all_non_empty : t -> unit

Move all non-empty buffers to ready

val has_ready : t -> bool
val pop_ready : t -> f:(Buf.t Stdlib.Queue.t -> 'a) -> 'a0

Get access to ready buffers, then clean them up automatically

val max_size_word : t -> int

Maximum size available, in words, for a single message

val with_buf : t -> available_word:int -> (Buf.t -> 'a) -> 'a0

Obtain a buffer with at least available_word 64-bit words

val dispose : t -> unit

Dispose of resources (here, recycle buffers)