-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathmodes.mli
48 lines (40 loc) · 2.15 KB
/
modes.mli
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
39
40
41
42
43
44
45
46
47
48
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Thomas Del Vecchio, Jane Street, New York *)
(* *)
(* Copyright 2024 Jane Street Group LLC *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(** Modes are an experimental compiler feature, supported in the compiler branch found at:
https://github.com/ocaml-flambda/ocaml-jst
This module provides types that wrap a value in a different mode from its context. In
the standard OCaml compiler, these types are all no-op wrappers. *)
module Global : sig
type 'a t = { global : 'a @@ global } [@@unboxed]
(** Wraps values in the [global] mode, even in a [local] context. *)
end
module Portable : sig
type 'a t = { portable : 'a @@ portable } [@@unboxed]
end
module Contended : sig
type 'a t = { contended : 'a @@ contended } [@@unboxed]
(** Wraps values in the [contended] mode, even in an [uncontended] context. *)
end
module Portended : sig
type 'a t = { portended : 'a @@ portable contended } [@@unboxed]
(** Wraps values in the [portable contended] mode, even in a [nonportable uncontended]
context. A ['a Portended.t] is equivalent to a ['a Portable.t Contended.t] and a
['a Contended.t Portable.t], but much more ergonomic to work with. *)
end
module Aliased : sig
type 'a t = { aliased : 'a @@ aliased } [@@unboxed]
end
module Shared : sig
type 'a t = { shared : 'a @@ shared } [@@unboxed]
end