diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/gc.ml | 1 | ||||
-rw-r--r-- | stdlib/gc.mli | 12 | ||||
-rw-r--r-- | stdlib/sys.ml | 6 | ||||
-rw-r--r-- | stdlib/sys.mli | 8 |
4 files changed, 24 insertions, 3 deletions
diff --git a/stdlib/gc.ml b/stdlib/gc.ml index c50dbaef4..b2d89cce5 100644 --- a/stdlib/gc.ml +++ b/stdlib/gc.ml @@ -45,6 +45,7 @@ external counters : unit -> (float * float * float) = "gc_counters";; external get : unit -> control = "gc_get";; external set : control -> unit = "gc_set";; external minor : unit -> unit = "gc_minor";; +external major_slice : int -> int = "gc_major_slice";; external major : unit -> unit = "gc_major";; external full_major : unit -> unit = "gc_full_major";; external compact : unit -> unit = "gc_compaction";; diff --git a/stdlib/gc.mli b/stdlib/gc.mli index 81b7be578..a14fef87d 100644 --- a/stdlib/gc.mli +++ b/stdlib/gc.mli @@ -150,12 +150,18 @@ external set : control -> unit = "gc_set" external minor : unit -> unit = "gc_minor" (** Trigger a minor collection. *) +external major_slice : int -> int = "gc_major_slice";; +(** Do a minor collection and a slice of major collection. The argument + is the size of the slice, 0 to use the automatically-computed + slice size. In all cases, the result is the computed slice size. *) + external major : unit -> unit = "gc_major" -(** Finish the current major collection cycle. *) +(** Do a minor collection and finish the current major collection cycle. *) external full_major : unit -> unit = "gc_full_major" -(** Finish the current major collection cycle and perform a complete - new cycle. This will collect all currently unreachable blocks. *) +(** Do a minor collection, finish the current major collection cycle, + and perform a complete new cycle. This will collect all currently + unreachable blocks. *) external compact : unit -> unit = "gc_compaction" (** Perform a full major collection and compact the heap. Note that heap diff --git a/stdlib/sys.ml b/stdlib/sys.ml index d7baca331..b666a5a8a 100644 --- a/stdlib/sys.ml +++ b/stdlib/sys.ml @@ -73,3 +73,9 @@ let catch_break on = set_signal sigint (Signal_handle(fun _ -> raise Break)) else set_signal sigint Signal_default + + +(* OCaml version numbers and strings, moved from utils/config.mlp. + Must be in the format described in sys.mli. *) + +let ocaml_version = "3.04+6 (2002-02-05)" diff --git a/stdlib/sys.mli b/stdlib/sys.mli index 236c63561..5333628e2 100644 --- a/stdlib/sys.mli +++ b/stdlib/sys.mli @@ -169,3 +169,11 @@ val catch_break : bool -> unit Call [catch_break true] to enable raising [Break], and [catch_break false] to let the system terminate the program on user interrupt. *) + + +val ocaml_version : string;; +(** [ocaml_version] is the version of Objective Caml. + It is a string of the form ["major.minor[additional-info] (date)"] + Where major and minor are integers, date is in standard format + (i.e. YYYY-MM-DD), and [additional-info] is a string that may be + empty and does not start with a digit. *) |