type buf = Cstruct.tType of a C buffer (in this case, a Cstruct)
type t = private (char, Bigarray_compat.int8_unsigned_elt, Bigarray_compat.c_layout) Bigarray_compat.Array1.tType of memory blocks.
val get_addr : t -> nativeintget_addr t returns the address of the underlying bigarray of t. This is useful for debugging
val get_page : t -> nativeintget_page t returns the page offset (get_addr t) mod page_size, starting at 0 .
val get : int -> tget n allocates and returns a memory block of n pages. If there is not enough memory, an Out_of_memory exception is raised. Note that this may be a recoverable situation, since this function allocates memory from a page-aligned pool, whereas the OCaml garbage collector will be running in its own heap that may have spare memory despite the Out_of_memory being raised from this function call.
val get_buf : ?n:int -> unit -> bufget_buf n allocates and returns a memory block of n pages, represented as a Cstruct.t. If there is not enough memory, an Out_of_memory exception is raised.
val get_order : int -> tget_order i is get (1 lsl i).
val pages : int -> t listpages n allocates a memory block of n pages and return the list of pages allocated.
val pages_order : int -> t listpages_order i is pages (1 lsl i).
val length : t -> intlength t is the size of t, in bytes.
of_cstruct t converts a page-aligned buffer back to an Io_page. It raises Buffer_is_not_page_aligned if t is not page aligned or Buffer_not_multiple_of_page_size if t is not a whole number of pages in length. TODO: currently assumes the underlying Bigarray is page aligned.
val to_string : t -> stringto_string t will allocate a fresh string and copy the contents of t into the string.
to_pages t is a list of size memory blocks of one page each, where size is the size of t in pages.
val string_blit : string -> int -> t -> int -> int -> unitstring_blit src srcoff dst dstoff len copies len bytes from string src, starting at byte number srcoff, to memory block dst, starting at byte number dstoff.
blit t1 t2 is the same as Bigarray.Array1.blit.