File: bi_share.mli

package info (click to toggle)
biniou 1.0.12-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 216 kB
  • sloc: ml: 1,808; makefile: 175
file content (38 lines) | stat: -rw-r--r-- 1,009 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(** \[not for general use\] *)

(**/**)

type type_id
val dummy_type_id : type_id
val create_type_id : unit -> type_id

module Wr :
sig
  type tbl
  val create : int -> tbl
  val clear : tbl -> unit

  val put : tbl -> ('a * type_id) -> int -> int
    (** [put tbl x pos] returns 0 if [x] is not already in the table
	and adds [x] to the table.  [pos] is the absolute position
	of the first byte of the ref value excluding its tag.
	If [x] is found in the table, then the difference between
	[pos] and the original position is returned.
    *)
end

module Rd :
sig
  type tbl
  val create : int -> tbl
  val clear : tbl -> unit

  val put : tbl -> (int * type_id) -> Obj.t -> unit
    (** [put tbl pos x] puts the position of a new shared value into the
	table.  [pos] is the absolute position of the first byte
	of the ref value excluding its tag. *)

  val get : tbl -> (int * type_id) -> Obj.t
    (** [get tbl pos] returns the value stored at this position
	or raises a {!Bi_util.Error} exception. *)
end