Functional storage using Merkle Patricia tree
Module type
Class type
Library plebeia
Module Plebeia . Mmap
module Arch64 : sig ... end

Arch64 is included in 64bit arch. Otherwise Arch32 is included

module Buffer : sig ... end

Memory buffer

type t

Type of mmap'ed file

val make : Unix.file_descr -> pos:int64 -> shared:bool -> int64 -> 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 msync_lwt : t -> 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