package plebeia

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Buffer : sig ... end

Memory buffer

type t

Type of mmap'ed file

val make : Unix.file_descr -> pos:int -> shared:bool -> int -> t

make fd ~pos ~shared len maps the region of the file specified by fd, pos, and len to an mmap. If shared=true, the modifications to t is shared with other processes and written back to the file.

val null : t

Build a dummy empty mmap. get_buffer always fails.

val is_null : t -> bool
val msync : t -> unit

Call msync(2) to flush the changes to the mapped file

val msync2 : t -> off:int -> len:int -> unit
val msync_lwt : t -> unit Lwt.t
val msync2_lwt : t -> off:int -> len:int -> unit Lwt.t
val madvise_random : t -> unit
val get_buffer : off:int -> len:int -> t -> Buffer.t

Get a buffer to read/write the specified region of the mmap

val len : t -> int

The length of the mmap in bytes

val get_char : t -> int -> char
val init : int -> (int -> char) -> t

On memory map

OCaml

Innovation. Community. Security.