Skip to content

Commit

Permalink
Merge pull request #11744 from jmid/weak-check-missing-exception
Browse files Browse the repository at this point in the history
Weak.check missing exception in documentation
  • Loading branch information
abbysmal committed Nov 23, 2022
2 parents ee75054 + 1d07fca commit 408bba1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions stdlib/weak.mli
Expand Up @@ -53,13 +53,13 @@ val set : 'a t -> int -> 'a option -> unit
(full) pointer to [el]; [Weak.set ar n None] sets the [n]th
cell of [ar] to empty.
@raise Invalid_argument if [n] is not in the range
0 to {!Weak.length}[ a - 1].*)
0 to {!Weak.length}[ ar - 1].*)

val get : 'a t -> int -> 'a option
(** [Weak.get ar n] returns None if the [n]th cell of [ar] is
empty, [Some x] (where [x] is the value) if it is full.
@raise Invalid_argument if [n] is not in the range
0 to {!Weak.length}[ a - 1].*)
0 to {!Weak.length}[ ar - 1].*)

val get_copy : 'a t -> int -> 'a option
(** [Weak.get_copy ar n] returns None if the [n]th cell of [ar] is
Expand All @@ -70,7 +70,7 @@ val get_copy : 'a t -> int -> 'a option
the incremental GC from erasing the value in its current cycle
([get] may delay the erasure to the next GC cycle).
@raise Invalid_argument if [n] is not in the range
0 to {!Weak.length}[ a - 1].
0 to {!Weak.length}[ ar - 1].
If the element is a custom block it is not copied.
Expand All @@ -80,13 +80,15 @@ val get_copy : 'a t -> int -> 'a option
val check : 'a t -> int -> bool
(** [Weak.check ar n] returns [true] if the [n]th cell of [ar] is
full, [false] if it is empty. Note that even if [Weak.check ar n]
returns [true], a subsequent {!Weak.get}[ ar n] can return [None].*)
returns [true], a subsequent {!Weak.get}[ ar n] can return [None].
@raise Invalid_argument if [n] is not in the range
0 to {!Weak.length}[ ar - 1].*)

val fill : 'a t -> int -> int -> 'a option -> unit
(** [Weak.fill ar ofs len el] sets to [el] all pointers of [ar] from
[ofs] to [ofs + len - 1].
@raise Invalid_argument
if [ofs] and [len] do not designate a valid subarray of [a].*)
if [ofs] and [len] do not designate a valid subarray of [ar].*)

val blit : 'a t -> int -> 'a t -> int -> int -> unit
(** [Weak.blit ar1 off1 ar2 off2 len] copies [len] weak pointers
Expand Down

0 comments on commit 408bba1

Please sign in to comment.