Restore Hashtbl.rebuild in .mli, fix docstring

master
John Whitington 2020-07-27 14:12:54 +01:00
parent 33fdfffd5f
commit bec7f8ff3d
3 changed files with 54 additions and 6 deletions

View File

@ -195,10 +195,26 @@ val randomize : unit -> unit
@since 4.00.0 *)
val is_randomized : unit -> bool
(** return if the tables are currently created in randomized mode by default
(** Return [true] if the tables are currently created in randomized mode
by default, [false] otherwise.
@since 4.03.0 *)
val rebuild : ?random (* thwart tools/unlabel *) :bool -> ('a, 'b) t -> ('a, 'b) t
(** Return a copy of the given hashtable. Unlike {!copy},
[{!rebuild} h] re-hashes all the (key, value) entries of
the original table [h]. The returned hash table is randomized if
[h] was randomized, or the optional [random] parameter is true, or
if the default is to create randomized hash tables; see
{!create} for more information.
{!rebuild} can safely be used to import a hash table built
by an old version of the {!Hashtbl} module, then marshaled to
persistent storage. After unmarshaling, apply {!rebuild}
to produce a hash table for the current version of the {!Hashtbl}
module.
@since 4.12.0 *)
(** @since 4.00.0 *)
type statistics = {
num_bindings: int;

View File

@ -206,10 +206,26 @@ val randomize : unit -> unit
@since 4.00.0 *)
val is_randomized : unit -> bool
(** return if the tables are currently created in randomized mode by default
(** Return [true] if the tables are currently created in randomized mode
by default, [false] otherwise.
@since 4.03.0 *)
val rebuild : ?random (* thwart tools/unlabel *) :bool -> ('a, 'b) t -> ('a, 'b) t
(** Return a copy of the given hashtable. Unlike {!copy},
[{!rebuild} h] re-hashes all the (key, value) entries of
the original table [h]. The returned hash table is randomized if
[h] was randomized, or the optional [random] parameter is true, or
if the default is to create randomized hash tables; see
{!create} for more information.
{!rebuild} can safely be used to import a hash table built
by an old version of the {!Hashtbl} module, then marshaled to
persistent storage. After unmarshaling, apply {!rebuild}
to produce a hash table for the current version of the {!Hashtbl}
module.
@since 4.12.0 *)
(** @since 4.00.0 *)
type statistics = Hashtbl.statistics = {
num_bindings: int;

View File

@ -195,10 +195,26 @@ val randomize : unit -> unit
@since 4.00.0 *)
val is_randomized : unit -> bool
(** return if the tables are currently created in randomized mode by default
(** Return [true] if the tables are currently created in randomized mode
by default, [false] otherwise.
@since 4.03.0 *)
val rebuild : ?random (* thwart tools/unlabel *) :bool -> ('a, 'b) t -> ('a, 'b) t
(** Return a copy of the given hashtable. Unlike {!copy},
[{!rebuild} h] re-hashes all the (key, value) entries of
the original table [h]. The returned hash table is randomized if
[h] was randomized, or the optional [random] parameter is true, or
if the default is to create randomized hash tables; see
{!create} for more information.
{!rebuild} can safely be used to import a hash table built
by an old version of the {!Hashtbl} module, then marshaled to
persistent storage. After unmarshaling, apply {!rebuild}
to produce a hash table for the current version of the {!Hashtbl}
module.
@since 4.12.0 *)
(** @since 4.00.0 *)
type statistics = {
num_bindings: int;