package cactus

  1. Overview
  2. Docs
exception RandomFailure
type t

The type for store handles.

type address = int

The type of page addresses.

type page

The type of pages.

module Common : sig ... end
module Page : sig ... end
val init : root:string -> t

init root opens a store at path root.

val root : t -> address

root t is the address of the root of the btree.

val reroot : t -> address -> unit

reroot s a changes the address of the root of s to a.

val load : t -> address -> page

load t a loads in memory the page at address a.

val reload : t -> address -> unit

reload t a moves a between caches. Called after a newly created page, it adds it to the right level of cache.

val release : t -> unit

release store tells the store that no loaded pages is going to be written on. This allows the store to clean part of the cache, and must be called as frequently as possible.

val clear_cache : t -> unit
val allocate : t -> address

allocate t allocates a new page (with junk contents) and returns the address of the new page.

val deallocate : t -> address -> unit

deallocate t a deallocates the page at the address a.

val flush : t -> unit
val fsync : t -> unit
val clear : t -> unit

clear t removes every binding in t.

val close : t -> unit
val iter : t -> (address -> page -> unit) -> unit

iter t f applies f on all alive pages in the btree.

val pp_header : t Fmt.t
module Private : sig ... end