Library
Module
Module type
Parameter
Class
Class type
Sslconf buffer.
This implements Openssl's buffer allocation policy in an OCaml runtime.
nbits
-1.from Openssl: buffer.h buffer.c
An Sslconf buffer supports an underlying Bytes.t
buffer. empty nbits
is the constructor. Max allocated size is 2**nbits
-1 bytes. A good default nbits
value is 31. length
bytes are expected, These bytes are initialized to a null value. Dynamic allocated size is (floor((length + 3) / 3) * 4) bytes.
val empty : int -> t
empty nbits
creates an empty buffer.
val extend : t -> int -> (t, string * int * int * int) Rresult.result
extend buf length
extends buf
to support length
bytes. Ok buf
or Error (msg length nbits allocation_limit)
is returned. New bytes up to Bytes.length (Buf.data buf)
are initialized to null. An error occurs, and no allocation is done, if length
would cause an allocation greater than buffer max allocated size.