* [gentoo-commits] repo/gentoo:master commit in: dev-ml/batteries/, dev-ml/batteries/files/
@ 2016-02-09 8:45 Alexis Ballier
0 siblings, 0 replies; 4+ messages in thread
From: Alexis Ballier @ 2016-02-09 8:45 UTC (permalink / raw
To: gentoo-commits
commit: 799a551ba5cdc7232f92e07fc0aa2e9f8a5cf573
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 9 07:48:55 2016 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue Feb 9 08:45:48 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=799a551b
dev-ml/batteries: remove old
Package-Manager: portage-2.2.27
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
dev-ml/batteries/Manifest | 3 ---
dev-ml/batteries/batteries-2.1.ebuild | 23 ----------------------
dev-ml/batteries/batteries-2.2.ebuild | 22 ---------------------
dev-ml/batteries/batteries-2.3.ebuild | 22 ---------------------
.../batteries/files/batteries-2.1-ocaml-4.01.patch | 21 --------------------
5 files changed, 91 deletions(-)
diff --git a/dev-ml/batteries/Manifest b/dev-ml/batteries/Manifest
index 432291e..3861d64 100644
--- a/dev-ml/batteries/Manifest
+++ b/dev-ml/batteries/Manifest
@@ -1,4 +1 @@
-DIST batteries-2.1.tar.gz 695812 SHA256 ad7b85ebc4404192ef101fa143147dd12713017de7941d71c64f7c7d354e91bf SHA512 03fa0d9ba3333e0b80d2aec087453c13497b419f22229432e7c99a519a03a013c647c9a09e32250f17dad3fe47975ff76901df9dd289c87a877e4665ac344f70 WHIRLPOOL 29c50e51b74964971412a2026d571644920cd367c22b6c62375d19ff4a87342e50a46164317b5da3b40d7d51c2fcf33a3000ba67588ff9a8fbc3608d4f0f1120
-DIST batteries-2.2.tar.gz 711616 SHA256 7a7139ffa0c0da356a3be63a1024eb15f15eaf6d396b999565e77f77ca789c7c SHA512 023d919cbb402e1386334865dfbd17a5a7a2eb07f8ddce682bab37b1d4b140bf5ce90519744d026ae012da20abbddf65707cff5e2568c9682b8fc69cf3f0977a WHIRLPOOL ba61455f2f4323c420f7b53424449bdda40ddf8f3766d31ac91b4f043d07bd19c53fc6f7d5d47de3debcf1cf30210696a24201e78fc2163a8726a19310b7e274
-DIST batteries-2.3.tar.gz 728917 SHA256 f54276dfad1b00a90d6d64c4e35621879a1a9409e024f9267155071725d209fe SHA512 0f55e75cc8057ec4ba9683aee91509a3bf2ee93d1990a932cd3924cd602aeeea80a5da50b0651500fc153285b1d80b9378ec1fa656e7f94311e992e9ba308c88 WHIRLPOOL bdab9410456e35f5251dc9994507faf602bb617fd7077b444003960528e38fdf0c97ccab96cd0d4a265402fa457a66635d6948e1c87dac9793069e0b34a18029
DIST batteries-2.4.0.tar.gz 739489 SHA256 f13ff15efa35c272e1e63a2604f92c1823d5685cd73d3d6cf00f25f80178439f SHA512 091aad40268aa3826f840e5abdb8be75665df3d026aae4206d467c2e2b2b2f10746280c2baecca3bc9b66a51aadb2346801d1e41ce9ff3cc3b7fd9808b63d193 WHIRLPOOL f1206abea0e1bed86b55e89f511112e113505b6dc4d2ccae185b83fdbddcec0389b1a302b9fca2531e5ba76c24278f68bdd785a187410d984d24f1dddd8a62cf
diff --git a/dev-ml/batteries/batteries-2.1.ebuild b/dev-ml/batteries/batteries-2.1.ebuild
deleted file mode 100644
index 1ce1fec..0000000
--- a/dev-ml/batteries/batteries-2.1.ebuild
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit oasis
-
-DESCRIPTION="The community-maintained foundation library for your OCaml projects"
-HOMEPAGE="http://batteries.forge.ocamlcore.org/"
-SRC_URI="https://forge.ocamlcore.org/frs/download.php/1218/${P}.tar.gz"
-
-LICENSE="LGPL-2.1-with-linking-exception"
-SLOT="0/${PV}"
-KEYWORDS="~amd64"
-IUSE="test"
-
-RDEPEND="dev-ml/camomile:="
-DEPEND="${RDEPEND}
- test? ( dev-ml/ounit dev-ml/iTeML )"
-
-DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" )
-PATCHES=( "${FILESDIR}/${P}-ocaml-4.01.patch" )
diff --git a/dev-ml/batteries/batteries-2.2.ebuild b/dev-ml/batteries/batteries-2.2.ebuild
deleted file mode 100644
index af9f5d2..0000000
--- a/dev-ml/batteries/batteries-2.2.ebuild
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit oasis
-
-DESCRIPTION="The community-maintained foundation library for your OCaml projects"
-HOMEPAGE="http://batteries.forge.ocamlcore.org/"
-SRC_URI="https://forge.ocamlcore.org/frs/download.php/1363/${P}.tar.gz"
-
-LICENSE="LGPL-2.1-with-linking-exception"
-SLOT="0/${PV}"
-KEYWORDS="~amd64"
-IUSE="test"
-
-RDEPEND="dev-ml/camomile:="
-DEPEND="${RDEPEND}
- test? ( dev-ml/ounit dev-ml/iTeML )"
-
-DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" )
diff --git a/dev-ml/batteries/batteries-2.3.ebuild b/dev-ml/batteries/batteries-2.3.ebuild
deleted file mode 100644
index 93a7734..0000000
--- a/dev-ml/batteries/batteries-2.3.ebuild
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit oasis
-
-DESCRIPTION="The community-maintained foundation library for your OCaml projects"
-HOMEPAGE="http://batteries.forge.ocamlcore.org/"
-SRC_URI="https://forge.ocamlcore.org/frs/download.php/1465/${P}.tar.gz"
-
-LICENSE="LGPL-2.1-with-linking-exception"
-SLOT="0/${PV}"
-KEYWORDS="~amd64"
-IUSE="test"
-
-RDEPEND="dev-ml/camomile:="
-DEPEND="${RDEPEND}
- test? ( dev-ml/ounit dev-ml/iTeML )"
-
-DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" )
diff --git a/dev-ml/batteries/files/batteries-2.1-ocaml-4.01.patch b/dev-ml/batteries/files/batteries-2.1-ocaml-4.01.patch
deleted file mode 100644
index 4919479..0000000
--- a/dev-ml/batteries/files/batteries-2.1-ocaml-4.01.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-commit 1db918c5966c6f95dda9b2c4c26975b0a8fddb2c
-Author: Gabriel Scherer <gabriel.scherer@gmail.com>
-Date: Thu Aug 8 11:59:49 2013 +0200
-
- Add the new O_CLOEXEC flag to Unix.open_flag in version 4.1
-
-diff --git a/src/batUnix.mliv b/src/batUnix.mliv
-index bd710a7..943db0a 100644
---- a/src/batUnix.mliv
-+++ b/src/batUnix.mliv
-@@ -261,6 +261,10 @@ type open_flag = Unix.open_flag =
- O_SYNC/O_DSYNC) *)
- ##V4## | O_SHARE_DELETE (** OCaml 4 and Windows only: allow the file to be deleted
- ##V4## while still open *)
-+##V4.1## | O_CLOEXEC (** Set the close-on-exec flag on the
-+##V4.1## descriptor returned by {!openfile}
-+##V4.1##
-+##V4.1## Since OCaml 4.1 *)
- (** The flags to {!Unix.openfile}. *)
-
-
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-ml/batteries/, dev-ml/batteries/files/
@ 2016-05-03 9:14 Alexis Ballier
0 siblings, 0 replies; 4+ messages in thread
From: Alexis Ballier @ 2016-05-03 9:14 UTC (permalink / raw
To: gentoo-commits
commit: 5875c310922f8596089ad0e53b5adafc40e05d0b
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Sun May 1 14:03:13 2016 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue May 3 09:13:52 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5875c310
dev-ml/batteries: fix build with ocaml 4.03
Package-Manager: portage-2.2.28
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
dev-ml/batteries/batteries-2.4.0.ebuild | 5 +
dev-ml/batteries/files/oc43-1.patch | 762 ++++++++++++++++++++++++++++++++
dev-ml/batteries/files/oc43-2.patch | 344 ++++++++++++++
dev-ml/batteries/files/oc43-3.patch | 21 +
4 files changed, 1132 insertions(+)
diff --git a/dev-ml/batteries/batteries-2.4.0.ebuild b/dev-ml/batteries/batteries-2.4.0.ebuild
index 1548038..7ea0d79 100644
--- a/dev-ml/batteries/batteries-2.4.0.ebuild
+++ b/dev-ml/batteries/batteries-2.4.0.ebuild
@@ -22,3 +22,8 @@ DEPEND="${RDEPEND}
DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" )
S="${WORKDIR}/${PN}-included-${PV}"
+PATCHES=(
+ "${FILESDIR}/oc43-1.patch"
+ "${FILESDIR}/oc43-2.patch"
+ "${FILESDIR}/oc43-3.patch"
+)
diff --git a/dev-ml/batteries/files/oc43-1.patch b/dev-ml/batteries/files/oc43-1.patch
new file mode 100644
index 0000000..a032374
--- /dev/null
+++ b/dev-ml/batteries/files/oc43-1.patch
@@ -0,0 +1,762 @@
+commit 45bcb681e4218586b66f3a0d83d7f5a51f5548e0
+Author: KC Sivaramakrishnan <sk826@cl.cam.ac.uk>
+Date: Wed Mar 23 09:42:33 2016 +0000
+
+ Upgrading to 4.03
+
+diff --git a/src/batArray.mliv b/src/batArray.mliv
+index 51b4e28..025887f 100644
+--- a/src/batArray.mliv
++++ b/src/batArray.mliv
+@@ -82,8 +82,7 @@ external make : int -> 'a -> 'a array = "caml_make_vect"
+ If the value of [x] is a floating-point number, then the maximum
+ size is only [Sys.max_array_length / 2].*)
+
+-##V<4.2##val make_float : int -> float array
+-##V>=4.2##external make_float : int -> float array = "caml_make_float_vect"
++val make_float : int -> float array
+ (** [Array.make_float n] returns a fresh float array of length [n],
+ with uninitialized data.
+
+diff --git a/src/batCharParser.mli b/src/batCharParser.mli
+index 52c00d8..80ff8a8 100644
+--- a/src/batCharParser.mli
++++ b/src/batCharParser.mli
+@@ -52,7 +52,7 @@ val source_of_string : string -> (char, position) Source.t
+ val source_of_enum : char BatEnum.t -> (char, position) Source.t
+ (** Create a source from a latin-1 character.*)
+
+-val parse : (char, 'a, position) t -> string -> ('a, position report) BatPervasives.result
++val parse : (char, 'a, position) t -> string -> ('a, position report) result
+ (**Apply a parser to a string.*)
+
+ (**{6 Utilities}*)
+diff --git a/src/batGc.mli b/src/batGc.mli
+index f3e6f54..ecffb79 100644
+--- a/src/batGc.mli
++++ b/src/batGc.mli
+@@ -34,18 +34,18 @@
+ type stat = Gc.stat =
+ { minor_words : float;
+ (** Number of words allocated in the minor heap since
+- the program was started. This number is accurate in
+- byte-code programs, but only an approximation in programs
+- compiled to native code. *)
++ the program was started. This number is accurate in
++ byte-code programs, but only an approximation in programs
++ compiled to native code. *)
+
+ promoted_words : float;
+ (** Number of words allocated in the minor heap that
+- survived a minor collection and were moved to the major heap
+- since the program was started. *)
++ survived a minor collection and were moved to the major heap
++ since the program was started. *)
+
+ major_words : float;
+ (** Number of words allocated in the major heap, including
+- the promoted words, since the program was started. *)
++ the promoted words, since the program was started. *)
+
+ minor_collections : int;
+ (** Number of minor collections since the program was started. *)
+@@ -62,7 +62,7 @@ type stat = Gc.stat =
+
+ live_words : int;
+ (** Number of words of live data in the major heap, including the header
+- words. *)
++ words. *)
+
+ live_blocks : int;
+ (** Number of live blocks in the major heap. *)
+@@ -78,8 +78,8 @@ type stat = Gc.stat =
+
+ fragments : int;
+ (** Number of wasted words due to fragmentation. These are
+- 1-words free blocks placed between two live blocks. They
+- are not available for allocation. *)
++ 1-words free blocks placed between two live blocks. They
++ are not available for allocation. *)
+
+ compactions : int;
+ (** Number of heap compactions since the program was started. *)
+@@ -89,62 +89,68 @@ type stat = Gc.stat =
+
+ stack_size: int;
+ (** Current size of the stack, in words. @since 3.12.0 *)
+- }
++}
+ (** The memory management counters are returned in a [stat] record.
+
+- The total amount of memory allocated by the program since it was started
+- is (in words) [minor_words + major_words - promoted_words]. Multiply by
+- the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
+- the number of bytes.
++ The total amount of memory allocated by the program since it was started
++ is (in words) [minor_words + major_words - promoted_words]. Multiply by
++ the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
++ the number of bytes.
+ *)
+
+ type control = Gc.control =
+ { mutable minor_heap_size : int;
+ (** The size (in words) of the minor heap. Changing
+- this parameter will trigger a minor collection. Default: 32k. *)
++ this parameter will trigger a minor collection. Default: 256k. *)
+
+ mutable major_heap_increment : int;
+- (** The minimum number of words to add to the
+- major heap when increasing it. Default: 124k. *)
++ (** How much to add to the major heap when increasing it. If this
++ number is less than or equal to 1000, it is a percentage of
++ the current heap size (i.e. setting it to 100 will double the heap
++ size at each increase). If it is more than 1000, it is a fixed
++ number of words that will be added to the heap. Default: 15. *)
+
+ mutable space_overhead : int;
+ (** The major GC speed is computed from this parameter.
+- This is the memory that will be "wasted" because the GC does not
+- immediatly collect unreachable blocks. It is expressed as a
+- percentage of the memory used for live data.
+- The GC will work more (use more CPU time and collect
+- blocks more eagerly) if [space_overhead] is smaller.
+- Default: 80. *)
++ This is the memory that will be "wasted" because the GC does not
++ immediatly collect unreachable blocks. It is expressed as a
++ percentage of the memory used for live data.
++ The GC will work more (use more CPU time and collect
++ blocks more eagerly) if [space_overhead] is smaller.
++ Default: 80. *)
+
+ mutable verbose : int;
+ (** This value controls the GC messages on standard error output.
+- It is a sum of some of the following flags, to print messages
+- on the corresponding events:
+- - [0x001] Start of major GC cycle.
+- - [0x002] Minor collection and major GC slice.
+- - [0x004] Growing and shrinking of the heap.
+- - [0x008] Resizing of stacks and memory manager tables.
+- - [0x010] Heap compaction.
+- - [0x020] Change of GC parameters.
+- - [0x040] Computation of major GC slice size.
+- - [0x080] Calling of finalisation functions.
+- - [0x100] Bytecode executable search at start-up.
+- - [0x200] Computation of compaction triggering condition.
+- Default: 0. *)
++ It is a sum of some of the following flags, to print messages
++ on the corresponding events:
++ - [0x001] Start of major GC cycle.
++ - [0x002] Minor collection and major GC slice.
++ - [0x004] Growing and shrinking of the heap.
++ - [0x008] Resizing of stacks and memory manager tables.
++ - [0x010] Heap compaction.
++ - [0x020] Change of GC parameters.
++ - [0x040] Computation of major GC slice size.
++ - [0x080] Calling of finalisation functions.
++ - [0x100] Bytecode executable and shared library search at start-up.
++ - [0x200] Computation of compaction-triggering condition.
++ - [0x400] Output GC statistics at program exit.
++ Default: 0. *)
+
+ mutable max_overhead : int;
+ (** Heap compaction is triggered when the estimated amount
+- of "wasted" memory is more than [max_overhead] percent of the
+- amount of live data. If [max_overhead] is set to 0, heap
+- compaction is triggered at the end of each major GC cycle
+- (this setting is intended for testing purposes only).
+- If [max_overhead >= 1000000], compaction is never triggered.
+- Default: 500. *)
++ of "wasted" memory is more than [max_overhead] percent of the
++ amount of live data. If [max_overhead] is set to 0, heap
++ compaction is triggered at the end of each major GC cycle
++ (this setting is intended for testing purposes only).
++ If [max_overhead >= 1000000], compaction is never triggered.
++ If compaction is permanently disabled, it is strongly suggested
++ to set [allocation_policy] to 1.
++ Default: 500. *)
+
+ mutable stack_limit : int;
+ (** The maximum size of the stack (in words). This is only
+- relevant to the byte-code runtime, as the native code runtime
+- uses the operating system's stack. Default: 256k. *)
++ relevant to the byte-code runtime, as the native code runtime
++ uses the operating system's stack. Default: 1024k. *)
+
+ mutable allocation_policy : int;
+ (** The policy used for allocating in the heap. Possible
+@@ -153,16 +159,22 @@ type control = Gc.control =
+ first-fit policy, which can be slower in some cases but
+ can be better for programs with fragmentation problems.
+ Default: 0. @since 3.11.0 *)
+- }
++
++ window_size : int;
++ (** The size of the window used by the major GC for smoothing
++ out variations in its workload. This is an integer between
++ 1 and 50.
++ Default: 1. @since 4.03.0 *)
++}
+ (** The GC parameters are given as a [control] record. Note that
+ these parameters can also be initialised by setting the
+ OCAMLRUNPARAM environment variable. See the documentation of
+- ocamlrun. *)
++ [ocamlrun]. *)
+
+ external stat : unit -> stat = "caml_gc_stat"
+ (** Return the current values of the memory management counters in a
+- [stat] record. This function examines every heap block to get the
+- statistics. *)
++ [stat] record. This function examines every heap block to get the
++ statistics. *)
+
+ external quick_stat : unit -> stat = "caml_gc_quick_stat"
+ (** Same as [stat] except that [live_words], [live_blocks], [free_words],
+@@ -172,117 +184,144 @@ external quick_stat : unit -> stat = "caml_gc_quick_stat"
+
+ external counters : unit -> float * float * float = "caml_gc_counters"
+ (** Return [(minor_words, promoted_words, major_words)]. This function
+- is as fast at [quick_stat]. *)
++ is as fast as [quick_stat]. *)
+
+ external get : unit -> control = "caml_gc_get"
+ (** Return the current values of the GC parameters in a [control] record. *)
+
+ external set : control -> unit = "caml_gc_set"
+ (** [set r] changes the GC parameters according to the [control] record [r].
+- The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
++ The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
+
+ external minor : unit -> unit = "caml_gc_minor"
+ (** Trigger a minor collection. *)
+
+-external major_slice : int -> int = "caml_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_slice : int -> int = "caml_gc_major_slice"
++(** [major_slice n]
++ Do a minor collection and a slice of major collection. [n] is the
++ size of the slice: the GC will do enough work to free (on average)
++ [n] words of memory. If [n] = 0, the GC will try to do enough work
++ to ensure that the next slice has no work to do.
++ Return an approximation of the work that the next slice will have
++ to do. *)
+
+ external major : unit -> unit = "caml_gc_major"
+ (** Do a minor collection and finish the current major collection cycle. *)
+
+ external full_major : unit -> unit = "caml_gc_full_major"
+ (** Do a minor collection, finish the current major collection cycle,
+- and perform a complete new cycle. This will collect all currently
+- unreachable blocks. *)
++ and perform a complete new cycle. This will collect all currently
++ unreachable blocks. *)
+
+ external compact : unit -> unit = "caml_gc_compaction"
+ (** Perform a full major collection and compact the heap. Note that heap
+- compaction is a lengthy operation. *)
++ compaction is a lengthy operation. *)
+
+ val print_stat : _ BatInnerIO.output -> unit
+ (** Print the current values of the memory management counters (in
+- human-readable form) into the channel argument. *)
++ human-readable form) into the channel argument. *)
+
+ val allocated_bytes : unit -> float
+ (** Return the total number of bytes allocated since the program was
+- started. It is returned as a [float] to avoid overflow problems
+- with [int] on 32-bit machines. *)
++ started. It is returned as a [float] to avoid overflow problems
++ with [int] on 32-bit machines. *)
++
++external get_minor_free : unit -> int = "caml_get_minor_free" [@@noalloc]
++(** Return the current size of the free space inside the minor heap. *)
++
++external get_bucket : int -> int = "caml_get_major_bucket" [@@noalloc]
++(** [get_bucket n] returns the current size of the [n]-th future bucket
++ of the GC smoothing system. The unit is one millionth of a full GC.
++ Raise [Invalid_argument] if [n] is negative, return 0 if n is larger
++ than the smoothing window. *)
++
++external get_credit : unit -> int = "caml_get_major_credit" [@@noalloc]
++(** [get_credit ()] returns the current size of the "work done in advance"
++ counter of the GC smoothing system. The unit is one millionth of a
++ full GC. *)
++
++external huge_fallback_count : unit -> int = "caml_gc_huge_fallback_count"
++(** Return the number of times we tried to map huge pages and had to fall
++ back to small pages. This is always 0 if [OCAMLRUNPARAM] contains [H=1].
++ @since 4.03.0 *)
+
+ val finalise : ('a -> unit) -> 'a -> unit
+ (** [finalise f v] registers [f] as a finalisation function for [v].
+- [v] must be heap-allocated. [f] will be called with [v] as
+- argument at some point between the first time [v] becomes unreachable
+- and the time [v] is collected by the GC. Several functions can
+- be registered for the same value, or even several instances of the
+- same function. Each instance will be called once (or never,
+- if the program terminates before [v] becomes unreachable).
+-
+- The GC will call the finalisation functions in the order of
+- deallocation. When several values become unreachable at the
+- same time (i.e. during the same GC cycle), the finalisation
+- functions will be called in the reverse order of the corresponding
+- calls to [finalise]. If [finalise] is called in the same order
+- as the values are allocated, that means each value is finalised
+- before the values it depends upon. Of course, this becomes
+- false if additional dependencies are introduced by assignments.
+-
+- Anything reachable from the closure of finalisation functions
+- is considered reachable, so the following code will not work
+- as expected:
+- - [ let v = ... in Gc.finalise (fun x -> ...) v ]
+-
+- Instead you should write:
+- - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
+-
+-
+- The [f] function can use all features of OCaml, including
+- assignments that make the value reachable again. It can also
+- loop forever (in this case, the other
+- finalisation functions will not be called during the execution of f,
+- unless it calls [finalise_release]).
+- It can call [finalise] on [v] or other values to register other
+- functions or even itself. It can raise an exception; in this case
+- the exception will interrupt whatever the program was doing when
+- the function was called.
+-
+-
+- [finalise] will raise [Invalid_argument] if [v] is not
+- heap-allocated. Some examples of values that are not
+- heap-allocated are integers, constant constructors, booleans,
+- the empty array, the empty list, the unit value. The exact list
+- of what is heap-allocated or not is implementation-dependent.
+- Some constant values can be heap-allocated but never deallocated
+- during the lifetime of the program, for example a list of integer
+- constants; this is also implementation-dependent.
+- You should also be aware that compiler optimisations may duplicate
+- some immutable values, for example floating-point numbers when
+- stored into arrays, so they can be finalised and collected while
+- another copy is still in use by the program.
+-
+-
+- The results of calling {!String.make}, {!String.create},
+- {!Array.make}, and {!Pervasives.ref} are guaranteed to be
+- heap-allocated and non-constant except when the length argument is [0].
++ [v] must be heap-allocated. [f] will be called with [v] as
++ argument at some point between the first time [v] becomes unreachable
++ (including through weak pointers) and the time [v] is collected by
++ the GC. Several functions can
++ be registered for the same value, or even several instances of the
++ same function. Each instance will be called once (or never,
++ if the program terminates before [v] becomes unreachable).
++
++ The GC will call the finalisation functions in the order of
++ deallocation. When several values become unreachable at the
++ same time (i.e. during the same GC cycle), the finalisation
++ functions will be called in the reverse order of the corresponding
++ calls to [finalise]. If [finalise] is called in the same order
++ as the values are allocated, that means each value is finalised
++ before the values it depends upon. Of course, this becomes
++ false if additional dependencies are introduced by assignments.
++
++ In the presence of multiple OCaml threads it should be assumed that
++ any particular finaliser may be executed in any of the threads.
++
++ Anything reachable from the closure of finalisation functions
++ is considered reachable, so the following code will not work
++ as expected:
++ - [ let v = ... in Gc.finalise (fun _ -> ...v...) v ]
++
++ Instead you should make sure that [v] is not in the closure of
++ the finalisation function by writing:
++ - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
++
++
++ The [f] function can use all features of OCaml, including
++ assignments that make the value reachable again. It can also
++ loop forever (in this case, the other
++ finalisation functions will not be called during the execution of f,
++ unless it calls [finalise_release]).
++ It can call [finalise] on [v] or other values to register other
++ functions or even itself. It can raise an exception; in this case
++ the exception will interrupt whatever the program was doing when
++ the function was called.
++
++
++ [finalise] will raise [Invalid_argument] if [v] is not
++ guaranteed to be heap-allocated. Some examples of values that are not
++ heap-allocated are integers, constant constructors, booleans,
++ the empty array, the empty list, the unit value. The exact list
++ of what is heap-allocated or not is implementation-dependent.
++ Some constant values can be heap-allocated but never deallocated
++ during the lifetime of the program, for example a list of integer
++ constants; this is also implementation-dependent.
++ Note that values of types [float] and ['a lazy] (for any ['a]) are
++ sometimes allocated and sometimes not, so finalising them is unsafe,
++ and [finalise] will also raise [Invalid_argument] for them.
++
++
++ The results of calling {!String.make}, {!Bytes.make}, {!Bytes.create},
++ {!Array.make}, and {!Pervasives.ref} are guaranteed to be
++ heap-allocated and non-constant except when the length argument is [0].
+ *)
+
+-val finalise_release : unit -> unit;;
++val finalise_release : unit -> unit
+ (** A finalisation function may call [finalise_release] to tell the
+ GC that it can launch the next finalisation function without waiting
+ for the current one to return. *)
+
+ type alarm = Gc.alarm
+ (** An alarm is a piece of data that calls a user function at the end of
+- each major GC cycle. The following functions are provided to create
+- and delete alarms. *)
++ each major GC cycle. The following functions are provided to create
++ and delete alarms. *)
+
+ val create_alarm : (unit -> unit) -> alarm
+ (** [create_alarm f] will arrange for [f] to be called at the end of each
+- major GC cycle, starting with the current cycle or the next one.
+- A value of type [alarm] is returned that you can
+- use to call [delete_alarm]. *)
++ major GC cycle, starting with the current cycle or the next one.
++ A value of type [alarm] is returned that you can
++ use to call [delete_alarm]. *)
+
+ val delete_alarm : alarm -> unit
+- (** [delete_alarm a] will stop the calls to the function associated
+- to [a]. Calling [delete_alarm a] again has no effect. *)
++(** [delete_alarm a] will stop the calls to the function associated
++ to [a]. Calling [delete_alarm a] again has no effect. *)
+diff --git a/src/batHashtbl.mli b/src/batHashtbl.mli
+index d3a9118..dd95c0c 100644
+--- a/src/batHashtbl.mli
++++ b/src/batHashtbl.mli
+@@ -276,7 +276,7 @@ val print : ?first:string -> ?last:string -> ?sep:string -> ?kvsep:string ->
+ module Exceptionless :
+ sig
+ val find : ('a, 'b) t -> 'a -> 'b option
+- val modify : 'a -> ('b -> 'b) -> ('a, 'b) t -> (unit, exn) BatPervasives.result
++ val modify : 'a -> ('b -> 'b) -> ('a, 'b) t -> (unit, exn) result
+ end
+
+ (** Infix operators over a {!BatHashtbl} *)
+@@ -402,7 +402,7 @@ sig
+ module Exceptionless :
+ sig
+ val find : 'a t -> key -> 'a option
+- val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) BatPervasives.result
++ val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) result
+ end
+
+ (** Infix operators over a {!BatHashtbl} *)
+@@ -562,7 +562,7 @@ sig
+ module Exceptionless :
+ sig
+ val find : ('a, 'b, [>`Read]) t -> 'a -> 'b option
+- val modify : 'a -> ('b -> 'b) -> ('a, 'b, [>`Read]) t -> (unit, exn) BatPervasives.result
++ val modify : 'a -> ('b -> 'b) -> ('a, 'b, [>`Read]) t -> (unit, exn) result
+ end
+
+ (** Operations on {!BatHashtbl.Cap} with labels.*)
+diff --git a/src/batHashtbl.mlv b/src/batHashtbl.mlv
+index 6a79a33..ef7a030 100644
+--- a/src/batHashtbl.mlv
++++ b/src/batHashtbl.mlv
+@@ -413,7 +413,7 @@ sig
+ module Exceptionless :
+ sig
+ val find : 'a t -> key -> 'a option
+- val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) BatPervasives.result
++ val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) result
+ end
+
+ (** Infix operators over a {!BatHashtbl} *)
+@@ -571,7 +571,7 @@ struct
+ let map_inplace (f:key -> 'a -> 'b) h = map_inplace f (to_hash h)
+ let filteri_inplace f h = filteri_inplace f (to_hash h)
+ let filter_inplace f h = filter_inplace f (to_hash h)
+- let filter_map_inplace f h = filter_map_inplace f (to_hash h)
++ let filter_map_inplace f h = filter_map_inplace f h
+
+
+ let find_option h key =
+diff --git a/src/batInnerPervasives.mlv b/src/batInnerPervasives.mlv
+index c86f1f7..c81cba4 100644
+--- a/src/batInnerPervasives.mlv
++++ b/src/batInnerPervasives.mlv
+@@ -43,20 +43,16 @@ let unique () =
+ Q.unit (fun () -> unique () <> unique ())
+ *)
+
+-type ('a, 'b) result =
+- | Ok of 'a
+- | Bad of 'b
+-
+ (* Ideas taken from Nicholas Pouillard's my_std.ml in ocamlbuild/ *)
+ let ignore_ok = function
+ Ok _ -> ()
+- | Bad ex -> raise ex
++ | Error ex -> raise ex
+
+ let ok = function
+ Ok v -> v
+- | Bad ex -> raise ex
++ | Error ex -> raise ex
+
+-let wrap f x = try Ok (f x) with ex -> Bad ex
++let wrap f x = try Ok (f x) with ex -> Error ex
+
+ let forever f x = ignore (while true do f x done)
+
+diff --git a/src/batInnerWeaktbl.ml b/src/batInnerWeaktbl.ml
+index 64bb15f..c525f62 100644
+--- a/src/batInnerWeaktbl.ml
++++ b/src/batInnerWeaktbl.ml
+@@ -120,6 +120,7 @@ module Make (H: Hashtbl.HashedType) : Hashtbl.S with type key = H.t = struct
+ W.iter (fun cls -> W.add tbl' (Stack.copy cls)) tbl; tbl'
+ let stats _ = assert false
+ let reset _ = assert false
++ let filter_map_inplace _ = assert false
+ end
+
+ module StdHash = Make
+diff --git a/src/batParserCo.ml b/src/batParserCo.ml
+index cac4701..75ac6fb 100644
+--- a/src/batParserCo.ml
++++ b/src/batParserCo.ml
+@@ -274,10 +274,10 @@ let lookahead p e = match apply p e with
+ | Failure _ as result -> result
+
+ let interpret_result = function
+- | Setback f | Failure f -> BatInnerPervasives.Bad f
+- | Success (r, _) | Backtrack (r, _, _) -> BatInnerPervasives.Ok r
++ | Setback f | Failure f -> Error f
++ | Success (r, _) | Backtrack (r, _, _) -> Ok r
+
+-let suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) BatInnerPervasives.result), 'c) t = fun s e ->
++let suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) Pervasives.result), 'c) t = fun s e ->
+ let resume () = interpret_result (s e) in
+ Success (resume, e)
+
+diff --git a/src/batParserCo.mli b/src/batParserCo.mli
+index 1fbe15a..40c5cf7 100644
+--- a/src/batParserCo.mli
++++ b/src/batParserCo.mli
+@@ -141,15 +141,15 @@ val filter: ('b -> bool) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t
+ (**[filter f p] is only accepts values [x] such that [p]
+ accepts [x] and [f (p x)] is [true]*)
+
+-val suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) BatPervasives.result), 'c) t
++val suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) result), 'c) t
+ (**[suspend s] returns the state of the parser in a form that can be
+ resumed by calling the returned function. evaluation will resume
+ from parser s *)
+
+-val run: ('a, 'b, 'c) t -> ('a, 'c) Source.t -> ('b, 'c report) BatPervasives.result
++val run: ('a, 'b, 'c) t -> ('a, 'c) Source.t -> ('b, 'c report) result
+ (**[run p s] executes parser [p] on source [s]. In case of
+ success, returns [Ok v], where [v] is the return value of [p].
+- In case of failure, returns [Bad f], with [f] containing
++ In case of failure, returns [Error f], with [f] containing
+ details on the parsing error.*)
+
+
+diff --git a/src/batPathGen.ml b/src/batPathGen.ml
+index 46a97ba..71d1084 100644
+--- a/src/batPathGen.ml
++++ b/src/batPathGen.ml
+@@ -512,7 +512,7 @@ module Make = functor (S : StringType) -> struct
+ let full_match pars ss =
+ let parser_final = BatParserCo.( >>> ) pars BatParserCo.eof in
+ match BatParserCo.run parser_final (S.Parse.source ss) with
+- | BatPervasives.Ok _ -> true
++ | Ok _ -> true
+ | _ -> false
+
+ (* let full_match_none_of raw_excluded ss =
+diff --git a/src/batPervasives.mliv b/src/batPervasives.mliv
+index 6353214..c74b913 100644
+--- a/src/batPervasives.mliv
++++ b/src/batPervasives.mliv
+@@ -842,20 +842,14 @@ val print : ?first:string -> ?last:string -> ?sep:string -> ('a BatInnerIO.outp
+
+ For more functions related to this type, see the {!BatResult} module.
+ *)
+-type ('a, 'b) result = ('a, 'b) BatInnerPervasives.result =
+- | Ok of 'a
+- | Bad of 'b
+- (** The result of a computation - either an [Ok] with the normal
+- result or a [Bad] with some value (often an exception) containing
+- failure information*)
+
+ val ignore_ok : ('a, exn) result -> unit
+ (** [ignore_ok (f x)] ignores the result of [f x] if it's ok, but
+- throws the exception contained if [Bad] is returned. *)
++ throws the exception contained if [Error] is returned. *)
+
+ val ok : ('a, exn) result -> 'a
+ (** [f x |> ok] unwraps the [Ok] result of [f x] and returns it, or
+- throws the exception contained if [Bad] is returned. *)
++ throws the exception contained if [Error] is returned. *)
+
+ val wrap : ('a -> 'b) -> 'a -> ('b, exn) result
+ (** [wrap f x] wraps a function that would normally throw an exception
+diff --git a/src/batResult.ml b/src/batResult.ml
+index 1d98663..f90b4d9 100644
+--- a/src/batResult.ml
++++ b/src/batResult.ml
+@@ -1,45 +1,45 @@
+
+-type ('a, 'b) t = ('a, 'b) BatPervasives.result =
++type ('a, 'b) t = ('a, 'b) result =
+ | Ok of 'a
+- | Bad of 'b
++ | Error of 'b
+
+-let catch f x = try Ok (f x) with e -> Bad e
+-let catch2 f x y = try Ok (f x y) with e -> Bad e
+-let catch3 f x y z = try Ok (f x y z) with e -> Bad e
++let catch f x = try Ok (f x) with e -> Error e
++let catch2 f x y = try Ok (f x y) with e -> Error e
++let catch3 f x y z = try Ok (f x y z) with e -> Error e
+
+ let of_option = function
+ | Some x -> Ok x
+- | None -> Bad ()
++ | None -> Error ()
+
+ let to_option = function
+ | Ok x -> Some x
+- | Bad _-> None
++ | Error _-> None
+
+ let default def = function
+ | Ok x -> x
+- | Bad _ -> def
++ | Error _ -> def
+
+ let map_default def f = function
+ | Ok x -> f x
+- | Bad _ -> def
++ | Error _ -> def
+
+-let is_ok = function Ok _ -> true | Bad _ -> false
++let is_ok = function Ok _ -> true | Error _ -> false
+
+-let is_bad = function Bad _ -> true | Ok _ -> false
++let is_bad = function Error _ -> true | Ok _ -> false
+
+-let is_exn e = function Bad exn -> exn = e | Ok _ -> false
++let is_exn e = function Error exn -> exn = e | Ok _ -> false
+
+-let get = function Ok x -> x | Bad e -> raise e
++let get = function Ok x -> x | Error e -> raise e
+
+ let print print_val oc = function
+ | Ok x -> BatPrintf.fprintf oc "Ok(%a)" print_val x
+- | Bad e -> BatPrintf.fprintf oc "Bad(%a)" BatPrintexc.print e
++ | Error e -> BatPrintf.fprintf oc "Error(%a)" BatPrintexc.print e
+
+
+ module Monad = struct
+ let bind m k = match m with
+ | Ok x -> k x
+- | Bad _ as e -> e
++ | Error _ as e -> e
+
+ let return x = Ok x
+
+diff --git a/src/batResult.mli b/src/batResult.mli
+index a295c64..203c125 100644
+--- a/src/batResult.mli
++++ b/src/batResult.mli
+@@ -1,12 +1,12 @@
+ (** Monadic results of computations that can raise exceptions *)
+
+ (** The type of a result. A result is either [Ok x] carrying the
+- normal return value [x] or is [Bad e] carrying some indication of an
++ normal return value [x] or is [Error e] carrying some indication of an
+ error. The value associated with a bad result is usually an exception
+ ([exn]) that can be raised.
+ @since 1.0
+ *)
+-type ('a, 'b) t = ('a, 'b) BatPervasives.result = Ok of 'a | Bad of 'b
++type ('a, 'b) t = ('a, 'b) result = Ok of 'a | Error of 'b
+
+ (** Execute a function and catch any exception as a result. This
+ function encapsulates code that could throw an exception and returns
+@@ -26,19 +26,19 @@ val catch2: ('a -> 'b -> 'c) -> 'a -> 'b -> ('c, exn) t
+ val catch3: ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> ('d, exn) t
+
+
+-(** [get (Ok x)] returns [x], and [get (Bad e)] raises [e]. This
++(** [get (Ok x)] returns [x], and [get (Error e)] raises [e]. This
+ function is, in a way, the opposite of the [catch] function
+ @since 2.0
+ *)
+ val get : ('a, exn) t -> 'a
+
+-(** [default d r] evaluates to [d] if [r] is [Bad] else [x] when [r] is
++(** [default d r] evaluates to [d] if [r] is [Error] else [x] when [r] is
+ [Ok x]
+ @since 2.0
+ *)
+ val default: 'a -> ('a, _) t -> 'a
+
+-(** [map_default d f r] evaluates to [d] if [r] is [Bad] else [f x]
++(** [map_default d f r] evaluates to [d] if [r] is [Error] else [f x]
+ when [r] is [Ok x]
+ @since 2.0
+ *)
+@@ -49,12 +49,12 @@ val map_default : 'b -> ('a -> 'b) -> ('a, _) t -> 'b
+ *)
+ val is_ok : ('a, 'b) t -> bool
+
+-(** [is_bad (Bad _)] is [true], otherwise [false]
++(** [is_bad (Error _)] is [true], otherwise [false]
+ @since 2.0
+ *)
+ val is_bad : ('a, 'b) t -> bool
+
+-(** [is_exn e1 r] is [true] iff [r] is [Bad e2] with [e1=e2] *)
++(** [is_exn e1 r] is [true] iff [r] is [Error e2] with [e1=e2] *)
+ val is_exn : exn -> ('a, exn) t -> bool
+
+ (** Convert an [option] to a [result]
+@@ -96,5 +96,5 @@ module Infix : sig
+ val ( >>= ): ('a, 'b) t -> ('a -> ('c, 'b) t) -> ('c, 'b) t
+ end
+
+-(** Print a result as Ok(x) or Bad(exn) *)
++(** Print a result as Ok(x) or Error(exn) *)
+ val print : ('b BatInnerIO.output -> 'a -> unit) -> 'b BatInnerIO.output -> ('a, exn) t -> unit
+diff --git a/src/batSys.mliv b/src/batSys.mliv
+index 510a661..add0b33 100644
+--- a/src/batSys.mliv
++++ b/src/batSys.mliv
+@@ -65,7 +65,8 @@ external getenv : string -> string = "caml_sys_getenv"
+ external command : string -> int = "caml_sys_system_command"
+ (** Execute the given shell command and return its exit code. *)
+
+-external time : unit -> float = "caml_sys_time"
++##V<4.3## external time : unit -> float = "caml_sys_time"
++##V>=4.3## external time : unit -> (float [@unboxed]) = "caml_sys_time" "caml_sys_time_unboxed" [@@noalloc]
+ (** Return the processor time, in seconds, used by the program
+ since the beginning of execution. *)
+
+diff --git a/src/batUnix.mliv b/src/batUnix.mliv
+index 60a6ec4..069d63a 100644
+--- a/src/batUnix.mliv
++++ b/src/batUnix.mliv
+@@ -766,7 +766,8 @@ val create_process_env :
+ (** {6 Symbolic links} *)
+
+
+-val symlink : string -> string -> unit
++##V>=4.3##val symlink : ?to_dir:bool -> string -> string -> unit
++##V<4.3##val symlink : string -> string -> unit
+ (** [symlink source dest] creates the file [dest] as a symbolic link
+ to the file [source]. *)
+
diff --git a/dev-ml/batteries/files/oc43-2.patch b/dev-ml/batteries/files/oc43-2.patch
new file mode 100644
index 0000000..36d8e41
--- /dev/null
+++ b/dev-ml/batteries/files/oc43-2.patch
@@ -0,0 +1,344 @@
+commit 905cbb6a3ebf1edc11745737feeedd36708149a7
+Author: KC Sivaramakrishnan <sk826@cl.cam.ac.uk>
+Date: Wed Mar 23 10:11:46 2016 +0000
+
+ Spacing edits
+
+diff --git a/src/batGc.mli b/src/batGc.mli
+index ecffb79..494b9b1 100644
+--- a/src/batGc.mli
++++ b/src/batGc.mli
+@@ -34,18 +34,18 @@
+ type stat = Gc.stat =
+ { minor_words : float;
+ (** Number of words allocated in the minor heap since
+- the program was started. This number is accurate in
+- byte-code programs, but only an approximation in programs
+- compiled to native code. *)
++ the program was started. This number is accurate in
++ byte-code programs, but only an approximation in programs
++ compiled to native code. *)
+
+ promoted_words : float;
+ (** Number of words allocated in the minor heap that
+- survived a minor collection and were moved to the major heap
+- since the program was started. *)
++ survived a minor collection and were moved to the major heap
++ since the program was started. *)
+
+ major_words : float;
+ (** Number of words allocated in the major heap, including
+- the promoted words, since the program was started. *)
++ the promoted words, since the program was started. *)
+
+ minor_collections : int;
+ (** Number of minor collections since the program was started. *)
+@@ -62,7 +62,7 @@ type stat = Gc.stat =
+
+ live_words : int;
+ (** Number of words of live data in the major heap, including the header
+- words. *)
++ words. *)
+
+ live_blocks : int;
+ (** Number of live blocks in the major heap. *)
+@@ -78,8 +78,8 @@ type stat = Gc.stat =
+
+ fragments : int;
+ (** Number of wasted words due to fragmentation. These are
+- 1-words free blocks placed between two live blocks. They
+- are not available for allocation. *)
++ 1-words free blocks placed between two live blocks. They
++ are not available for allocation. *)
+
+ compactions : int;
+ (** Number of heap compactions since the program was started. *)
+@@ -92,16 +92,16 @@ type stat = Gc.stat =
+ }
+ (** The memory management counters are returned in a [stat] record.
+
+- The total amount of memory allocated by the program since it was started
+- is (in words) [minor_words + major_words - promoted_words]. Multiply by
+- the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
+- the number of bytes.
++ The total amount of memory allocated by the program since it was started
++ is (in words) [minor_words + major_words - promoted_words]. Multiply by
++ the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
++ the number of bytes.
+ *)
+
+ type control = Gc.control =
+ { mutable minor_heap_size : int;
+ (** The size (in words) of the minor heap. Changing
+- this parameter will trigger a minor collection. Default: 256k. *)
++ this parameter will trigger a minor collection. Default: 256k. *)
+
+ mutable major_heap_increment : int;
+ (** How much to add to the major heap when increasing it. If this
+@@ -112,45 +112,45 @@ type control = Gc.control =
+
+ mutable space_overhead : int;
+ (** The major GC speed is computed from this parameter.
+- This is the memory that will be "wasted" because the GC does not
+- immediatly collect unreachable blocks. It is expressed as a
+- percentage of the memory used for live data.
+- The GC will work more (use more CPU time and collect
+- blocks more eagerly) if [space_overhead] is smaller.
+- Default: 80. *)
++ This is the memory that will be "wasted" because the GC does not
++ immediatly collect unreachable blocks. It is expressed as a
++ percentage of the memory used for live data.
++ The GC will work more (use more CPU time and collect
++ blocks more eagerly) if [space_overhead] is smaller.
++ Default: 80. *)
+
+ mutable verbose : int;
+ (** This value controls the GC messages on standard error output.
+- It is a sum of some of the following flags, to print messages
+- on the corresponding events:
+- - [0x001] Start of major GC cycle.
+- - [0x002] Minor collection and major GC slice.
+- - [0x004] Growing and shrinking of the heap.
+- - [0x008] Resizing of stacks and memory manager tables.
+- - [0x010] Heap compaction.
+- - [0x020] Change of GC parameters.
+- - [0x040] Computation of major GC slice size.
+- - [0x080] Calling of finalisation functions.
+- - [0x100] Bytecode executable and shared library search at start-up.
+- - [0x200] Computation of compaction-triggering condition.
+- - [0x400] Output GC statistics at program exit.
+- Default: 0. *)
++ It is a sum of some of the following flags, to print messages
++ on the corresponding events:
++ - [0x001] Start of major GC cycle.
++ - [0x002] Minor collection and major GC slice.
++ - [0x004] Growing and shrinking of the heap.
++ - [0x008] Resizing of stacks and memory manager tables.
++ - [0x010] Heap compaction.
++ - [0x020] Change of GC parameters.
++ - [0x040] Computation of major GC slice size.
++ - [0x080] Calling of finalisation functions.
++ - [0x100] Bytecode executable and shared library search at start-up.
++ - [0x200] Computation of compaction-triggering condition.
++ - [0x400] Output GC statistics at program exit.
++ Default: 0. *)
+
+ mutable max_overhead : int;
+ (** Heap compaction is triggered when the estimated amount
+- of "wasted" memory is more than [max_overhead] percent of the
+- amount of live data. If [max_overhead] is set to 0, heap
+- compaction is triggered at the end of each major GC cycle
+- (this setting is intended for testing purposes only).
+- If [max_overhead >= 1000000], compaction is never triggered.
+- If compaction is permanently disabled, it is strongly suggested
+- to set [allocation_policy] to 1.
+- Default: 500. *)
++ of "wasted" memory is more than [max_overhead] percent of the
++ amount of live data. If [max_overhead] is set to 0, heap
++ compaction is triggered at the end of each major GC cycle
++ (this setting is intended for testing purposes only).
++ If [max_overhead >= 1000000], compaction is never triggered.
++ If compaction is permanently disabled, it is strongly suggested
++ to set [allocation_policy] to 1.
++ Default: 500. *)
+
+ mutable stack_limit : int;
+ (** The maximum size of the stack (in words). This is only
+- relevant to the byte-code runtime, as the native code runtime
+- uses the operating system's stack. Default: 1024k. *)
++ relevant to the byte-code runtime, as the native code runtime
++ uses the operating system's stack. Default: 1024k. *)
+
+ mutable allocation_policy : int;
+ (** The policy used for allocating in the heap. Possible
+@@ -173,8 +173,8 @@ type control = Gc.control =
+
+ external stat : unit -> stat = "caml_gc_stat"
+ (** Return the current values of the memory management counters in a
+- [stat] record. This function examines every heap block to get the
+- statistics. *)
++ [stat] record. This function examines every heap block to get the
++ statistics. *)
+
+ external quick_stat : unit -> stat = "caml_gc_quick_stat"
+ (** Same as [stat] except that [live_words], [live_blocks], [free_words],
+@@ -191,7 +191,7 @@ external get : unit -> control = "caml_gc_get"
+
+ external set : control -> unit = "caml_gc_set"
+ (** [set r] changes the GC parameters according to the [control] record [r].
+- The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
++ The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
+
+ external minor : unit -> unit = "caml_gc_minor"
+ (** Trigger a minor collection. *)
+@@ -210,21 +210,21 @@ external major : unit -> unit = "caml_gc_major"
+
+ external full_major : unit -> unit = "caml_gc_full_major"
+ (** Do a minor collection, finish the current major collection cycle,
+- and perform a complete new cycle. This will collect all currently
+- unreachable blocks. *)
++ and perform a complete new cycle. This will collect all currently
++ unreachable blocks. *)
+
+ external compact : unit -> unit = "caml_gc_compaction"
+ (** Perform a full major collection and compact the heap. Note that heap
+- compaction is a lengthy operation. *)
++ compaction is a lengthy operation. *)
+
+ val print_stat : _ BatInnerIO.output -> unit
+ (** Print the current values of the memory management counters (in
+- human-readable form) into the channel argument. *)
++ human-readable form) into the channel argument. *)
+
+ val allocated_bytes : unit -> float
+ (** Return the total number of bytes allocated since the program was
+- started. It is returned as a [float] to avoid overflow problems
+- with [int] on 32-bit machines. *)
++ started. It is returned as a [float] to avoid overflow problems
++ with [int] on 32-bit machines. *)
+
+ external get_minor_free : unit -> int = "caml_get_minor_free" [@@noalloc]
+ (** Return the current size of the free space inside the minor heap. *)
+@@ -247,63 +247,63 @@ external huge_fallback_count : unit -> int = "caml_gc_huge_fallback_count"
+
+ val finalise : ('a -> unit) -> 'a -> unit
+ (** [finalise f v] registers [f] as a finalisation function for [v].
+- [v] must be heap-allocated. [f] will be called with [v] as
+- argument at some point between the first time [v] becomes unreachable
+- (including through weak pointers) and the time [v] is collected by
+- the GC. Several functions can
+- be registered for the same value, or even several instances of the
+- same function. Each instance will be called once (or never,
+- if the program terminates before [v] becomes unreachable).
+-
+- The GC will call the finalisation functions in the order of
+- deallocation. When several values become unreachable at the
+- same time (i.e. during the same GC cycle), the finalisation
+- functions will be called in the reverse order of the corresponding
+- calls to [finalise]. If [finalise] is called in the same order
+- as the values are allocated, that means each value is finalised
+- before the values it depends upon. Of course, this becomes
+- false if additional dependencies are introduced by assignments.
+-
+- In the presence of multiple OCaml threads it should be assumed that
+- any particular finaliser may be executed in any of the threads.
+-
+- Anything reachable from the closure of finalisation functions
+- is considered reachable, so the following code will not work
+- as expected:
+- - [ let v = ... in Gc.finalise (fun _ -> ...v...) v ]
+-
+- Instead you should make sure that [v] is not in the closure of
+- the finalisation function by writing:
+- - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
+-
+-
+- The [f] function can use all features of OCaml, including
+- assignments that make the value reachable again. It can also
+- loop forever (in this case, the other
+- finalisation functions will not be called during the execution of f,
+- unless it calls [finalise_release]).
+- It can call [finalise] on [v] or other values to register other
+- functions or even itself. It can raise an exception; in this case
+- the exception will interrupt whatever the program was doing when
+- the function was called.
+-
+-
+- [finalise] will raise [Invalid_argument] if [v] is not
+- guaranteed to be heap-allocated. Some examples of values that are not
+- heap-allocated are integers, constant constructors, booleans,
+- the empty array, the empty list, the unit value. The exact list
+- of what is heap-allocated or not is implementation-dependent.
+- Some constant values can be heap-allocated but never deallocated
+- during the lifetime of the program, for example a list of integer
+- constants; this is also implementation-dependent.
+- Note that values of types [float] and ['a lazy] (for any ['a]) are
+- sometimes allocated and sometimes not, so finalising them is unsafe,
+- and [finalise] will also raise [Invalid_argument] for them.
+-
+-
+- The results of calling {!String.make}, {!Bytes.make}, {!Bytes.create},
+- {!Array.make}, and {!Pervasives.ref} are guaranteed to be
+- heap-allocated and non-constant except when the length argument is [0].
++ [v] must be heap-allocated. [f] will be called with [v] as
++ argument at some point between the first time [v] becomes unreachable
++ (including through weak pointers) and the time [v] is collected by
++ the GC. Several functions can
++ be registered for the same value, or even several instances of the
++ same function. Each instance will be called once (or never,
++ if the program terminates before [v] becomes unreachable).
++
++ The GC will call the finalisation functions in the order of
++ deallocation. When several values become unreachable at the
++ same time (i.e. during the same GC cycle), the finalisation
++ functions will be called in the reverse order of the corresponding
++ calls to [finalise]. If [finalise] is called in the same order
++ as the values are allocated, that means each value is finalised
++ before the values it depends upon. Of course, this becomes
++ false if additional dependencies are introduced by assignments.
++
++ In the presence of multiple OCaml threads it should be assumed that
++ any particular finaliser may be executed in any of the threads.
++
++ Anything reachable from the closure of finalisation functions
++ is considered reachable, so the following code will not work
++ as expected:
++ - [ let v = ... in Gc.finalise (fun _ -> ...v...) v ]
++
++ Instead you should make sure that [v] is not in the closure of
++ the finalisation function by writing:
++ - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
++
++
++ The [f] function can use all features of OCaml, including
++ assignments that make the value reachable again. It can also
++ loop forever (in this case, the other
++ finalisation functions will not be called during the execution of f,
++ unless it calls [finalise_release]).
++ It can call [finalise] on [v] or other values to register other
++ functions or even itself. It can raise an exception; in this case
++ the exception will interrupt whatever the program was doing when
++ the function was called.
++
++
++ [finalise] will raise [Invalid_argument] if [v] is not
++ guaranteed to be heap-allocated. Some examples of values that are not
++ heap-allocated are integers, constant constructors, booleans,
++ the empty array, the empty list, the unit value. The exact list
++ of what is heap-allocated or not is implementation-dependent.
++ Some constant values can be heap-allocated but never deallocated
++ during the lifetime of the program, for example a list of integer
++ constants; this is also implementation-dependent.
++ Note that values of types [float] and ['a lazy] (for any ['a]) are
++ sometimes allocated and sometimes not, so finalising them is unsafe,
++ and [finalise] will also raise [Invalid_argument] for them.
++
++
++ The results of calling {!String.make}, {!Bytes.make}, {!Bytes.create},
++ {!Array.make}, and {!Pervasives.ref} are guaranteed to be
++ heap-allocated and non-constant except when the length argument is [0].
+ *)
+
+ val finalise_release : unit -> unit
+@@ -313,15 +313,15 @@ val finalise_release : unit -> unit
+
+ type alarm = Gc.alarm
+ (** An alarm is a piece of data that calls a user function at the end of
+- each major GC cycle. The following functions are provided to create
+- and delete alarms. *)
++ each major GC cycle. The following functions are provided to create
++ and delete alarms. *)
+
+ val create_alarm : (unit -> unit) -> alarm
+ (** [create_alarm f] will arrange for [f] to be called at the end of each
+- major GC cycle, starting with the current cycle or the next one.
+- A value of type [alarm] is returned that you can
+- use to call [delete_alarm]. *)
++ major GC cycle, starting with the current cycle or the next one.
++ A value of type [alarm] is returned that you can
++ use to call [delete_alarm]. *)
+
+ val delete_alarm : alarm -> unit
+ (** [delete_alarm a] will stop the calls to the function associated
+- to [a]. Calling [delete_alarm a] again has no effect. *)
++ to [a]. Calling [delete_alarm a] again has no effect. *)
diff --git a/dev-ml/batteries/files/oc43-3.patch b/dev-ml/batteries/files/oc43-3.patch
new file mode 100644
index 0000000..95fa8fa
--- /dev/null
+++ b/dev-ml/batteries/files/oc43-3.patch
@@ -0,0 +1,21 @@
+commit 39393f8fc2d7c60dc093e9ea836077598dfbe955
+Author: KC Sivaramakrishnan <sk826@cl.cam.ac.uk>
+Date: Wed Mar 23 11:23:26 2016 +0000
+
+ Fix make_float versioning
+
+diff --git a/src/batArray.mliv b/src/batArray.mliv
+index 025887f..c6bfd02 100644
+--- a/src/batArray.mliv
++++ b/src/batArray.mliv
+@@ -82,7 +82,9 @@ external make : int -> 'a -> 'a array = "caml_make_vect"
+ If the value of [x] is a floating-point number, then the maximum
+ size is only [Sys.max_array_length / 2].*)
+
+-val make_float : int -> float array
++##V>=4.3##val make_float : int -> float array
++##V=4.2##external make_float : int -> float array = "caml_make_float_vect"
++##V<4.2##val make_float : int -> float array
+ (** [Array.make_float n] returns a fresh float array of length [n],
+ with uninitialized data.
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-ml/batteries/, dev-ml/batteries/files/
@ 2017-01-24 10:55 Alexis Ballier
0 siblings, 0 replies; 4+ messages in thread
From: Alexis Ballier @ 2017-01-24 10:55 UTC (permalink / raw
To: gentoo-commits
commit: a81ca5137d52c895f169351c1c144a6e645b5e19
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 24 10:49:03 2017 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue Jan 24 10:49:03 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a81ca513
dev-ml/batteries: remove old
Package-Manager: Portage-2.3.3, Repoman-2.3.1
dev-ml/batteries/Manifest | 2 -
dev-ml/batteries/batteries-2.4.0.ebuild | 31 --
dev-ml/batteries/batteries-2.5.2.ebuild | 24 -
dev-ml/batteries/files/oc43-1.patch | 762 --------------------------------
dev-ml/batteries/files/oc43-2.patch | 344 --------------
dev-ml/batteries/files/oc43-3.patch | 21 -
6 files changed, 1184 deletions(-)
diff --git a/dev-ml/batteries/Manifest b/dev-ml/batteries/Manifest
index d8f166c..5a016d7 100644
--- a/dev-ml/batteries/Manifest
+++ b/dev-ml/batteries/Manifest
@@ -1,3 +1 @@
-DIST batteries-2.4.0.tar.gz 739489 SHA256 f13ff15efa35c272e1e63a2604f92c1823d5685cd73d3d6cf00f25f80178439f SHA512 091aad40268aa3826f840e5abdb8be75665df3d026aae4206d467c2e2b2b2f10746280c2baecca3bc9b66a51aadb2346801d1e41ce9ff3cc3b7fd9808b63d193 WHIRLPOOL f1206abea0e1bed86b55e89f511112e113505b6dc4d2ccae185b83fdbddcec0389b1a302b9fca2531e5ba76c24278f68bdd785a187410d984d24f1dddd8a62cf
-DIST batteries-2.5.2.tar.gz 750624 SHA256 649038b47cdc2b7d4d4331fdb54b1e726212ce904c3472687a86aaa8d6006451 SHA512 310a2c88986cefe06424d428579203a5e147515fcd839a19daaedeca25803ef593d8eeb68027f26509fd820794b7928bf5ae56ff1aef852523ee91a4ce0d4d0d WHIRLPOOL eb4816ad84bac010460ca50e7f953fb2b05f3103444fcbc2e7b7b9a7a6f8dcf9fa5983f571128b6f8da38e0229a733b48dddbbb13fadc99deeffaea82ebaa744
DIST batteries-2.5.3.tar.gz 756020 SHA256 d437cfc8e65027425c081c8f72c2e4499f539ea5ea574bcabd372bdca45370b9 SHA512 d1b776c82a8a79c2908da5f5c7b7ee335ea8520e05b725910c03f4eb3c6e653619e1ff9fab8811d94a613620a84ec016651d13773e1ceea8830bb8c1ce7b46ba WHIRLPOOL 455a76a73037c5e0a2859699c080f6239158261f854c2bdca23f5fe7f7dcc33a8d6157c954ae207cd8a302643d632946953d2941009093720055ecff50762a23
diff --git a/dev-ml/batteries/batteries-2.4.0.ebuild b/dev-ml/batteries/batteries-2.4.0.ebuild
deleted file mode 100644
index b5a7c8f..00000000
--- a/dev-ml/batteries/batteries-2.4.0.ebuild
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit oasis
-
-DESCRIPTION="The community-maintained foundation library for your OCaml projects"
-HOMEPAGE="https://github.com/ocaml-batteries-team/batteries-included/"
-SRC_URI="https://github.com/ocaml-batteries-team/batteries-included/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="LGPL-2.1-with-linking-exception"
-SLOT="0/${PV}"
-KEYWORDS="~amd64"
-IUSE="test"
-
-RDEPEND="dev-ml/camomile:="
-DEPEND="${RDEPEND}
- test? ( dev-ml/ounit dev-ml/iTeML )"
-
-DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" )
-
-S="${WORKDIR}/${PN}-included-${PV}"
-
-src_prepare() {
- has_version '>=dev-lang/ocaml-4.03' && epatch \
- "${FILESDIR}/oc43-1.patch" \
- "${FILESDIR}/oc43-2.patch" \
- "${FILESDIR}/oc43-3.patch"
-}
diff --git a/dev-ml/batteries/batteries-2.5.2.ebuild b/dev-ml/batteries/batteries-2.5.2.ebuild
deleted file mode 100644
index 1548038..00000000
--- a/dev-ml/batteries/batteries-2.5.2.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit oasis
-
-DESCRIPTION="The community-maintained foundation library for your OCaml projects"
-HOMEPAGE="https://github.com/ocaml-batteries-team/batteries-included/"
-SRC_URI="https://github.com/ocaml-batteries-team/batteries-included/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="LGPL-2.1-with-linking-exception"
-SLOT="0/${PV}"
-KEYWORDS="~amd64"
-IUSE="test"
-
-RDEPEND="dev-ml/camomile:="
-DEPEND="${RDEPEND}
- test? ( dev-ml/ounit dev-ml/iTeML )"
-
-DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" )
-
-S="${WORKDIR}/${PN}-included-${PV}"
diff --git a/dev-ml/batteries/files/oc43-1.patch b/dev-ml/batteries/files/oc43-1.patch
deleted file mode 100644
index a032374..00000000
--- a/dev-ml/batteries/files/oc43-1.patch
+++ /dev/null
@@ -1,762 +0,0 @@
-commit 45bcb681e4218586b66f3a0d83d7f5a51f5548e0
-Author: KC Sivaramakrishnan <sk826@cl.cam.ac.uk>
-Date: Wed Mar 23 09:42:33 2016 +0000
-
- Upgrading to 4.03
-
-diff --git a/src/batArray.mliv b/src/batArray.mliv
-index 51b4e28..025887f 100644
---- a/src/batArray.mliv
-+++ b/src/batArray.mliv
-@@ -82,8 +82,7 @@ external make : int -> 'a -> 'a array = "caml_make_vect"
- If the value of [x] is a floating-point number, then the maximum
- size is only [Sys.max_array_length / 2].*)
-
--##V<4.2##val make_float : int -> float array
--##V>=4.2##external make_float : int -> float array = "caml_make_float_vect"
-+val make_float : int -> float array
- (** [Array.make_float n] returns a fresh float array of length [n],
- with uninitialized data.
-
-diff --git a/src/batCharParser.mli b/src/batCharParser.mli
-index 52c00d8..80ff8a8 100644
---- a/src/batCharParser.mli
-+++ b/src/batCharParser.mli
-@@ -52,7 +52,7 @@ val source_of_string : string -> (char, position) Source.t
- val source_of_enum : char BatEnum.t -> (char, position) Source.t
- (** Create a source from a latin-1 character.*)
-
--val parse : (char, 'a, position) t -> string -> ('a, position report) BatPervasives.result
-+val parse : (char, 'a, position) t -> string -> ('a, position report) result
- (**Apply a parser to a string.*)
-
- (**{6 Utilities}*)
-diff --git a/src/batGc.mli b/src/batGc.mli
-index f3e6f54..ecffb79 100644
---- a/src/batGc.mli
-+++ b/src/batGc.mli
-@@ -34,18 +34,18 @@
- type stat = Gc.stat =
- { minor_words : float;
- (** Number of words allocated in the minor heap since
-- the program was started. This number is accurate in
-- byte-code programs, but only an approximation in programs
-- compiled to native code. *)
-+ the program was started. This number is accurate in
-+ byte-code programs, but only an approximation in programs
-+ compiled to native code. *)
-
- promoted_words : float;
- (** Number of words allocated in the minor heap that
-- survived a minor collection and were moved to the major heap
-- since the program was started. *)
-+ survived a minor collection and were moved to the major heap
-+ since the program was started. *)
-
- major_words : float;
- (** Number of words allocated in the major heap, including
-- the promoted words, since the program was started. *)
-+ the promoted words, since the program was started. *)
-
- minor_collections : int;
- (** Number of minor collections since the program was started. *)
-@@ -62,7 +62,7 @@ type stat = Gc.stat =
-
- live_words : int;
- (** Number of words of live data in the major heap, including the header
-- words. *)
-+ words. *)
-
- live_blocks : int;
- (** Number of live blocks in the major heap. *)
-@@ -78,8 +78,8 @@ type stat = Gc.stat =
-
- fragments : int;
- (** Number of wasted words due to fragmentation. These are
-- 1-words free blocks placed between two live blocks. They
-- are not available for allocation. *)
-+ 1-words free blocks placed between two live blocks. They
-+ are not available for allocation. *)
-
- compactions : int;
- (** Number of heap compactions since the program was started. *)
-@@ -89,62 +89,68 @@ type stat = Gc.stat =
-
- stack_size: int;
- (** Current size of the stack, in words. @since 3.12.0 *)
-- }
-+}
- (** The memory management counters are returned in a [stat] record.
-
-- The total amount of memory allocated by the program since it was started
-- is (in words) [minor_words + major_words - promoted_words]. Multiply by
-- the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
-- the number of bytes.
-+ The total amount of memory allocated by the program since it was started
-+ is (in words) [minor_words + major_words - promoted_words]. Multiply by
-+ the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
-+ the number of bytes.
- *)
-
- type control = Gc.control =
- { mutable minor_heap_size : int;
- (** The size (in words) of the minor heap. Changing
-- this parameter will trigger a minor collection. Default: 32k. *)
-+ this parameter will trigger a minor collection. Default: 256k. *)
-
- mutable major_heap_increment : int;
-- (** The minimum number of words to add to the
-- major heap when increasing it. Default: 124k. *)
-+ (** How much to add to the major heap when increasing it. If this
-+ number is less than or equal to 1000, it is a percentage of
-+ the current heap size (i.e. setting it to 100 will double the heap
-+ size at each increase). If it is more than 1000, it is a fixed
-+ number of words that will be added to the heap. Default: 15. *)
-
- mutable space_overhead : int;
- (** The major GC speed is computed from this parameter.
-- This is the memory that will be "wasted" because the GC does not
-- immediatly collect unreachable blocks. It is expressed as a
-- percentage of the memory used for live data.
-- The GC will work more (use more CPU time and collect
-- blocks more eagerly) if [space_overhead] is smaller.
-- Default: 80. *)
-+ This is the memory that will be "wasted" because the GC does not
-+ immediatly collect unreachable blocks. It is expressed as a
-+ percentage of the memory used for live data.
-+ The GC will work more (use more CPU time and collect
-+ blocks more eagerly) if [space_overhead] is smaller.
-+ Default: 80. *)
-
- mutable verbose : int;
- (** This value controls the GC messages on standard error output.
-- It is a sum of some of the following flags, to print messages
-- on the corresponding events:
-- - [0x001] Start of major GC cycle.
-- - [0x002] Minor collection and major GC slice.
-- - [0x004] Growing and shrinking of the heap.
-- - [0x008] Resizing of stacks and memory manager tables.
-- - [0x010] Heap compaction.
-- - [0x020] Change of GC parameters.
-- - [0x040] Computation of major GC slice size.
-- - [0x080] Calling of finalisation functions.
-- - [0x100] Bytecode executable search at start-up.
-- - [0x200] Computation of compaction triggering condition.
-- Default: 0. *)
-+ It is a sum of some of the following flags, to print messages
-+ on the corresponding events:
-+ - [0x001] Start of major GC cycle.
-+ - [0x002] Minor collection and major GC slice.
-+ - [0x004] Growing and shrinking of the heap.
-+ - [0x008] Resizing of stacks and memory manager tables.
-+ - [0x010] Heap compaction.
-+ - [0x020] Change of GC parameters.
-+ - [0x040] Computation of major GC slice size.
-+ - [0x080] Calling of finalisation functions.
-+ - [0x100] Bytecode executable and shared library search at start-up.
-+ - [0x200] Computation of compaction-triggering condition.
-+ - [0x400] Output GC statistics at program exit.
-+ Default: 0. *)
-
- mutable max_overhead : int;
- (** Heap compaction is triggered when the estimated amount
-- of "wasted" memory is more than [max_overhead] percent of the
-- amount of live data. If [max_overhead] is set to 0, heap
-- compaction is triggered at the end of each major GC cycle
-- (this setting is intended for testing purposes only).
-- If [max_overhead >= 1000000], compaction is never triggered.
-- Default: 500. *)
-+ of "wasted" memory is more than [max_overhead] percent of the
-+ amount of live data. If [max_overhead] is set to 0, heap
-+ compaction is triggered at the end of each major GC cycle
-+ (this setting is intended for testing purposes only).
-+ If [max_overhead >= 1000000], compaction is never triggered.
-+ If compaction is permanently disabled, it is strongly suggested
-+ to set [allocation_policy] to 1.
-+ Default: 500. *)
-
- mutable stack_limit : int;
- (** The maximum size of the stack (in words). This is only
-- relevant to the byte-code runtime, as the native code runtime
-- uses the operating system's stack. Default: 256k. *)
-+ relevant to the byte-code runtime, as the native code runtime
-+ uses the operating system's stack. Default: 1024k. *)
-
- mutable allocation_policy : int;
- (** The policy used for allocating in the heap. Possible
-@@ -153,16 +159,22 @@ type control = Gc.control =
- first-fit policy, which can be slower in some cases but
- can be better for programs with fragmentation problems.
- Default: 0. @since 3.11.0 *)
-- }
-+
-+ window_size : int;
-+ (** The size of the window used by the major GC for smoothing
-+ out variations in its workload. This is an integer between
-+ 1 and 50.
-+ Default: 1. @since 4.03.0 *)
-+}
- (** The GC parameters are given as a [control] record. Note that
- these parameters can also be initialised by setting the
- OCAMLRUNPARAM environment variable. See the documentation of
-- ocamlrun. *)
-+ [ocamlrun]. *)
-
- external stat : unit -> stat = "caml_gc_stat"
- (** Return the current values of the memory management counters in a
-- [stat] record. This function examines every heap block to get the
-- statistics. *)
-+ [stat] record. This function examines every heap block to get the
-+ statistics. *)
-
- external quick_stat : unit -> stat = "caml_gc_quick_stat"
- (** Same as [stat] except that [live_words], [live_blocks], [free_words],
-@@ -172,117 +184,144 @@ external quick_stat : unit -> stat = "caml_gc_quick_stat"
-
- external counters : unit -> float * float * float = "caml_gc_counters"
- (** Return [(minor_words, promoted_words, major_words)]. This function
-- is as fast at [quick_stat]. *)
-+ is as fast as [quick_stat]. *)
-
- external get : unit -> control = "caml_gc_get"
- (** Return the current values of the GC parameters in a [control] record. *)
-
- external set : control -> unit = "caml_gc_set"
- (** [set r] changes the GC parameters according to the [control] record [r].
-- The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
-+ The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
-
- external minor : unit -> unit = "caml_gc_minor"
- (** Trigger a minor collection. *)
-
--external major_slice : int -> int = "caml_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_slice : int -> int = "caml_gc_major_slice"
-+(** [major_slice n]
-+ Do a minor collection and a slice of major collection. [n] is the
-+ size of the slice: the GC will do enough work to free (on average)
-+ [n] words of memory. If [n] = 0, the GC will try to do enough work
-+ to ensure that the next slice has no work to do.
-+ Return an approximation of the work that the next slice will have
-+ to do. *)
-
- external major : unit -> unit = "caml_gc_major"
- (** Do a minor collection and finish the current major collection cycle. *)
-
- external full_major : unit -> unit = "caml_gc_full_major"
- (** Do a minor collection, finish the current major collection cycle,
-- and perform a complete new cycle. This will collect all currently
-- unreachable blocks. *)
-+ and perform a complete new cycle. This will collect all currently
-+ unreachable blocks. *)
-
- external compact : unit -> unit = "caml_gc_compaction"
- (** Perform a full major collection and compact the heap. Note that heap
-- compaction is a lengthy operation. *)
-+ compaction is a lengthy operation. *)
-
- val print_stat : _ BatInnerIO.output -> unit
- (** Print the current values of the memory management counters (in
-- human-readable form) into the channel argument. *)
-+ human-readable form) into the channel argument. *)
-
- val allocated_bytes : unit -> float
- (** Return the total number of bytes allocated since the program was
-- started. It is returned as a [float] to avoid overflow problems
-- with [int] on 32-bit machines. *)
-+ started. It is returned as a [float] to avoid overflow problems
-+ with [int] on 32-bit machines. *)
-+
-+external get_minor_free : unit -> int = "caml_get_minor_free" [@@noalloc]
-+(** Return the current size of the free space inside the minor heap. *)
-+
-+external get_bucket : int -> int = "caml_get_major_bucket" [@@noalloc]
-+(** [get_bucket n] returns the current size of the [n]-th future bucket
-+ of the GC smoothing system. The unit is one millionth of a full GC.
-+ Raise [Invalid_argument] if [n] is negative, return 0 if n is larger
-+ than the smoothing window. *)
-+
-+external get_credit : unit -> int = "caml_get_major_credit" [@@noalloc]
-+(** [get_credit ()] returns the current size of the "work done in advance"
-+ counter of the GC smoothing system. The unit is one millionth of a
-+ full GC. *)
-+
-+external huge_fallback_count : unit -> int = "caml_gc_huge_fallback_count"
-+(** Return the number of times we tried to map huge pages and had to fall
-+ back to small pages. This is always 0 if [OCAMLRUNPARAM] contains [H=1].
-+ @since 4.03.0 *)
-
- val finalise : ('a -> unit) -> 'a -> unit
- (** [finalise f v] registers [f] as a finalisation function for [v].
-- [v] must be heap-allocated. [f] will be called with [v] as
-- argument at some point between the first time [v] becomes unreachable
-- and the time [v] is collected by the GC. Several functions can
-- be registered for the same value, or even several instances of the
-- same function. Each instance will be called once (or never,
-- if the program terminates before [v] becomes unreachable).
--
-- The GC will call the finalisation functions in the order of
-- deallocation. When several values become unreachable at the
-- same time (i.e. during the same GC cycle), the finalisation
-- functions will be called in the reverse order of the corresponding
-- calls to [finalise]. If [finalise] is called in the same order
-- as the values are allocated, that means each value is finalised
-- before the values it depends upon. Of course, this becomes
-- false if additional dependencies are introduced by assignments.
--
-- Anything reachable from the closure of finalisation functions
-- is considered reachable, so the following code will not work
-- as expected:
-- - [ let v = ... in Gc.finalise (fun x -> ...) v ]
--
-- Instead you should write:
-- - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
--
--
-- The [f] function can use all features of OCaml, including
-- assignments that make the value reachable again. It can also
-- loop forever (in this case, the other
-- finalisation functions will not be called during the execution of f,
-- unless it calls [finalise_release]).
-- It can call [finalise] on [v] or other values to register other
-- functions or even itself. It can raise an exception; in this case
-- the exception will interrupt whatever the program was doing when
-- the function was called.
--
--
-- [finalise] will raise [Invalid_argument] if [v] is not
-- heap-allocated. Some examples of values that are not
-- heap-allocated are integers, constant constructors, booleans,
-- the empty array, the empty list, the unit value. The exact list
-- of what is heap-allocated or not is implementation-dependent.
-- Some constant values can be heap-allocated but never deallocated
-- during the lifetime of the program, for example a list of integer
-- constants; this is also implementation-dependent.
-- You should also be aware that compiler optimisations may duplicate
-- some immutable values, for example floating-point numbers when
-- stored into arrays, so they can be finalised and collected while
-- another copy is still in use by the program.
--
--
-- The results of calling {!String.make}, {!String.create},
-- {!Array.make}, and {!Pervasives.ref} are guaranteed to be
-- heap-allocated and non-constant except when the length argument is [0].
-+ [v] must be heap-allocated. [f] will be called with [v] as
-+ argument at some point between the first time [v] becomes unreachable
-+ (including through weak pointers) and the time [v] is collected by
-+ the GC. Several functions can
-+ be registered for the same value, or even several instances of the
-+ same function. Each instance will be called once (or never,
-+ if the program terminates before [v] becomes unreachable).
-+
-+ The GC will call the finalisation functions in the order of
-+ deallocation. When several values become unreachable at the
-+ same time (i.e. during the same GC cycle), the finalisation
-+ functions will be called in the reverse order of the corresponding
-+ calls to [finalise]. If [finalise] is called in the same order
-+ as the values are allocated, that means each value is finalised
-+ before the values it depends upon. Of course, this becomes
-+ false if additional dependencies are introduced by assignments.
-+
-+ In the presence of multiple OCaml threads it should be assumed that
-+ any particular finaliser may be executed in any of the threads.
-+
-+ Anything reachable from the closure of finalisation functions
-+ is considered reachable, so the following code will not work
-+ as expected:
-+ - [ let v = ... in Gc.finalise (fun _ -> ...v...) v ]
-+
-+ Instead you should make sure that [v] is not in the closure of
-+ the finalisation function by writing:
-+ - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
-+
-+
-+ The [f] function can use all features of OCaml, including
-+ assignments that make the value reachable again. It can also
-+ loop forever (in this case, the other
-+ finalisation functions will not be called during the execution of f,
-+ unless it calls [finalise_release]).
-+ It can call [finalise] on [v] or other values to register other
-+ functions or even itself. It can raise an exception; in this case
-+ the exception will interrupt whatever the program was doing when
-+ the function was called.
-+
-+
-+ [finalise] will raise [Invalid_argument] if [v] is not
-+ guaranteed to be heap-allocated. Some examples of values that are not
-+ heap-allocated are integers, constant constructors, booleans,
-+ the empty array, the empty list, the unit value. The exact list
-+ of what is heap-allocated or not is implementation-dependent.
-+ Some constant values can be heap-allocated but never deallocated
-+ during the lifetime of the program, for example a list of integer
-+ constants; this is also implementation-dependent.
-+ Note that values of types [float] and ['a lazy] (for any ['a]) are
-+ sometimes allocated and sometimes not, so finalising them is unsafe,
-+ and [finalise] will also raise [Invalid_argument] for them.
-+
-+
-+ The results of calling {!String.make}, {!Bytes.make}, {!Bytes.create},
-+ {!Array.make}, and {!Pervasives.ref} are guaranteed to be
-+ heap-allocated and non-constant except when the length argument is [0].
- *)
-
--val finalise_release : unit -> unit;;
-+val finalise_release : unit -> unit
- (** A finalisation function may call [finalise_release] to tell the
- GC that it can launch the next finalisation function without waiting
- for the current one to return. *)
-
- type alarm = Gc.alarm
- (** An alarm is a piece of data that calls a user function at the end of
-- each major GC cycle. The following functions are provided to create
-- and delete alarms. *)
-+ each major GC cycle. The following functions are provided to create
-+ and delete alarms. *)
-
- val create_alarm : (unit -> unit) -> alarm
- (** [create_alarm f] will arrange for [f] to be called at the end of each
-- major GC cycle, starting with the current cycle or the next one.
-- A value of type [alarm] is returned that you can
-- use to call [delete_alarm]. *)
-+ major GC cycle, starting with the current cycle or the next one.
-+ A value of type [alarm] is returned that you can
-+ use to call [delete_alarm]. *)
-
- val delete_alarm : alarm -> unit
-- (** [delete_alarm a] will stop the calls to the function associated
-- to [a]. Calling [delete_alarm a] again has no effect. *)
-+(** [delete_alarm a] will stop the calls to the function associated
-+ to [a]. Calling [delete_alarm a] again has no effect. *)
-diff --git a/src/batHashtbl.mli b/src/batHashtbl.mli
-index d3a9118..dd95c0c 100644
---- a/src/batHashtbl.mli
-+++ b/src/batHashtbl.mli
-@@ -276,7 +276,7 @@ val print : ?first:string -> ?last:string -> ?sep:string -> ?kvsep:string ->
- module Exceptionless :
- sig
- val find : ('a, 'b) t -> 'a -> 'b option
-- val modify : 'a -> ('b -> 'b) -> ('a, 'b) t -> (unit, exn) BatPervasives.result
-+ val modify : 'a -> ('b -> 'b) -> ('a, 'b) t -> (unit, exn) result
- end
-
- (** Infix operators over a {!BatHashtbl} *)
-@@ -402,7 +402,7 @@ sig
- module Exceptionless :
- sig
- val find : 'a t -> key -> 'a option
-- val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) BatPervasives.result
-+ val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) result
- end
-
- (** Infix operators over a {!BatHashtbl} *)
-@@ -562,7 +562,7 @@ sig
- module Exceptionless :
- sig
- val find : ('a, 'b, [>`Read]) t -> 'a -> 'b option
-- val modify : 'a -> ('b -> 'b) -> ('a, 'b, [>`Read]) t -> (unit, exn) BatPervasives.result
-+ val modify : 'a -> ('b -> 'b) -> ('a, 'b, [>`Read]) t -> (unit, exn) result
- end
-
- (** Operations on {!BatHashtbl.Cap} with labels.*)
-diff --git a/src/batHashtbl.mlv b/src/batHashtbl.mlv
-index 6a79a33..ef7a030 100644
---- a/src/batHashtbl.mlv
-+++ b/src/batHashtbl.mlv
-@@ -413,7 +413,7 @@ sig
- module Exceptionless :
- sig
- val find : 'a t -> key -> 'a option
-- val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) BatPervasives.result
-+ val modify : key -> ('a -> 'a) -> 'a t -> (unit, exn) result
- end
-
- (** Infix operators over a {!BatHashtbl} *)
-@@ -571,7 +571,7 @@ struct
- let map_inplace (f:key -> 'a -> 'b) h = map_inplace f (to_hash h)
- let filteri_inplace f h = filteri_inplace f (to_hash h)
- let filter_inplace f h = filter_inplace f (to_hash h)
-- let filter_map_inplace f h = filter_map_inplace f (to_hash h)
-+ let filter_map_inplace f h = filter_map_inplace f h
-
-
- let find_option h key =
-diff --git a/src/batInnerPervasives.mlv b/src/batInnerPervasives.mlv
-index c86f1f7..c81cba4 100644
---- a/src/batInnerPervasives.mlv
-+++ b/src/batInnerPervasives.mlv
-@@ -43,20 +43,16 @@ let unique () =
- Q.unit (fun () -> unique () <> unique ())
- *)
-
--type ('a, 'b) result =
-- | Ok of 'a
-- | Bad of 'b
--
- (* Ideas taken from Nicholas Pouillard's my_std.ml in ocamlbuild/ *)
- let ignore_ok = function
- Ok _ -> ()
-- | Bad ex -> raise ex
-+ | Error ex -> raise ex
-
- let ok = function
- Ok v -> v
-- | Bad ex -> raise ex
-+ | Error ex -> raise ex
-
--let wrap f x = try Ok (f x) with ex -> Bad ex
-+let wrap f x = try Ok (f x) with ex -> Error ex
-
- let forever f x = ignore (while true do f x done)
-
-diff --git a/src/batInnerWeaktbl.ml b/src/batInnerWeaktbl.ml
-index 64bb15f..c525f62 100644
---- a/src/batInnerWeaktbl.ml
-+++ b/src/batInnerWeaktbl.ml
-@@ -120,6 +120,7 @@ module Make (H: Hashtbl.HashedType) : Hashtbl.S with type key = H.t = struct
- W.iter (fun cls -> W.add tbl' (Stack.copy cls)) tbl; tbl'
- let stats _ = assert false
- let reset _ = assert false
-+ let filter_map_inplace _ = assert false
- end
-
- module StdHash = Make
-diff --git a/src/batParserCo.ml b/src/batParserCo.ml
-index cac4701..75ac6fb 100644
---- a/src/batParserCo.ml
-+++ b/src/batParserCo.ml
-@@ -274,10 +274,10 @@ let lookahead p e = match apply p e with
- | Failure _ as result -> result
-
- let interpret_result = function
-- | Setback f | Failure f -> BatInnerPervasives.Bad f
-- | Success (r, _) | Backtrack (r, _, _) -> BatInnerPervasives.Ok r
-+ | Setback f | Failure f -> Error f
-+ | Success (r, _) | Backtrack (r, _, _) -> Ok r
-
--let suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) BatInnerPervasives.result), 'c) t = fun s e ->
-+let suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) Pervasives.result), 'c) t = fun s e ->
- let resume () = interpret_result (s e) in
- Success (resume, e)
-
-diff --git a/src/batParserCo.mli b/src/batParserCo.mli
-index 1fbe15a..40c5cf7 100644
---- a/src/batParserCo.mli
-+++ b/src/batParserCo.mli
-@@ -141,15 +141,15 @@ val filter: ('b -> bool) -> ('a, 'b, 'c) t -> ('a, 'b, 'c) t
- (**[filter f p] is only accepts values [x] such that [p]
- accepts [x] and [f (p x)] is [true]*)
-
--val suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) BatPervasives.result), 'c) t
-+val suspend : ('a, 'b, 'c) t -> ('a, (unit -> ('b, 'c report) result), 'c) t
- (**[suspend s] returns the state of the parser in a form that can be
- resumed by calling the returned function. evaluation will resume
- from parser s *)
-
--val run: ('a, 'b, 'c) t -> ('a, 'c) Source.t -> ('b, 'c report) BatPervasives.result
-+val run: ('a, 'b, 'c) t -> ('a, 'c) Source.t -> ('b, 'c report) result
- (**[run p s] executes parser [p] on source [s]. In case of
- success, returns [Ok v], where [v] is the return value of [p].
-- In case of failure, returns [Bad f], with [f] containing
-+ In case of failure, returns [Error f], with [f] containing
- details on the parsing error.*)
-
-
-diff --git a/src/batPathGen.ml b/src/batPathGen.ml
-index 46a97ba..71d1084 100644
---- a/src/batPathGen.ml
-+++ b/src/batPathGen.ml
-@@ -512,7 +512,7 @@ module Make = functor (S : StringType) -> struct
- let full_match pars ss =
- let parser_final = BatParserCo.( >>> ) pars BatParserCo.eof in
- match BatParserCo.run parser_final (S.Parse.source ss) with
-- | BatPervasives.Ok _ -> true
-+ | Ok _ -> true
- | _ -> false
-
- (* let full_match_none_of raw_excluded ss =
-diff --git a/src/batPervasives.mliv b/src/batPervasives.mliv
-index 6353214..c74b913 100644
---- a/src/batPervasives.mliv
-+++ b/src/batPervasives.mliv
-@@ -842,20 +842,14 @@ val print : ?first:string -> ?last:string -> ?sep:string -> ('a BatInnerIO.outp
-
- For more functions related to this type, see the {!BatResult} module.
- *)
--type ('a, 'b) result = ('a, 'b) BatInnerPervasives.result =
-- | Ok of 'a
-- | Bad of 'b
-- (** The result of a computation - either an [Ok] with the normal
-- result or a [Bad] with some value (often an exception) containing
-- failure information*)
-
- val ignore_ok : ('a, exn) result -> unit
- (** [ignore_ok (f x)] ignores the result of [f x] if it's ok, but
-- throws the exception contained if [Bad] is returned. *)
-+ throws the exception contained if [Error] is returned. *)
-
- val ok : ('a, exn) result -> 'a
- (** [f x |> ok] unwraps the [Ok] result of [f x] and returns it, or
-- throws the exception contained if [Bad] is returned. *)
-+ throws the exception contained if [Error] is returned. *)
-
- val wrap : ('a -> 'b) -> 'a -> ('b, exn) result
- (** [wrap f x] wraps a function that would normally throw an exception
-diff --git a/src/batResult.ml b/src/batResult.ml
-index 1d98663..f90b4d9 100644
---- a/src/batResult.ml
-+++ b/src/batResult.ml
-@@ -1,45 +1,45 @@
-
--type ('a, 'b) t = ('a, 'b) BatPervasives.result =
-+type ('a, 'b) t = ('a, 'b) result =
- | Ok of 'a
-- | Bad of 'b
-+ | Error of 'b
-
--let catch f x = try Ok (f x) with e -> Bad e
--let catch2 f x y = try Ok (f x y) with e -> Bad e
--let catch3 f x y z = try Ok (f x y z) with e -> Bad e
-+let catch f x = try Ok (f x) with e -> Error e
-+let catch2 f x y = try Ok (f x y) with e -> Error e
-+let catch3 f x y z = try Ok (f x y z) with e -> Error e
-
- let of_option = function
- | Some x -> Ok x
-- | None -> Bad ()
-+ | None -> Error ()
-
- let to_option = function
- | Ok x -> Some x
-- | Bad _-> None
-+ | Error _-> None
-
- let default def = function
- | Ok x -> x
-- | Bad _ -> def
-+ | Error _ -> def
-
- let map_default def f = function
- | Ok x -> f x
-- | Bad _ -> def
-+ | Error _ -> def
-
--let is_ok = function Ok _ -> true | Bad _ -> false
-+let is_ok = function Ok _ -> true | Error _ -> false
-
--let is_bad = function Bad _ -> true | Ok _ -> false
-+let is_bad = function Error _ -> true | Ok _ -> false
-
--let is_exn e = function Bad exn -> exn = e | Ok _ -> false
-+let is_exn e = function Error exn -> exn = e | Ok _ -> false
-
--let get = function Ok x -> x | Bad e -> raise e
-+let get = function Ok x -> x | Error e -> raise e
-
- let print print_val oc = function
- | Ok x -> BatPrintf.fprintf oc "Ok(%a)" print_val x
-- | Bad e -> BatPrintf.fprintf oc "Bad(%a)" BatPrintexc.print e
-+ | Error e -> BatPrintf.fprintf oc "Error(%a)" BatPrintexc.print e
-
-
- module Monad = struct
- let bind m k = match m with
- | Ok x -> k x
-- | Bad _ as e -> e
-+ | Error _ as e -> e
-
- let return x = Ok x
-
-diff --git a/src/batResult.mli b/src/batResult.mli
-index a295c64..203c125 100644
---- a/src/batResult.mli
-+++ b/src/batResult.mli
-@@ -1,12 +1,12 @@
- (** Monadic results of computations that can raise exceptions *)
-
- (** The type of a result. A result is either [Ok x] carrying the
-- normal return value [x] or is [Bad e] carrying some indication of an
-+ normal return value [x] or is [Error e] carrying some indication of an
- error. The value associated with a bad result is usually an exception
- ([exn]) that can be raised.
- @since 1.0
- *)
--type ('a, 'b) t = ('a, 'b) BatPervasives.result = Ok of 'a | Bad of 'b
-+type ('a, 'b) t = ('a, 'b) result = Ok of 'a | Error of 'b
-
- (** Execute a function and catch any exception as a result. This
- function encapsulates code that could throw an exception and returns
-@@ -26,19 +26,19 @@ val catch2: ('a -> 'b -> 'c) -> 'a -> 'b -> ('c, exn) t
- val catch3: ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> ('d, exn) t
-
-
--(** [get (Ok x)] returns [x], and [get (Bad e)] raises [e]. This
-+(** [get (Ok x)] returns [x], and [get (Error e)] raises [e]. This
- function is, in a way, the opposite of the [catch] function
- @since 2.0
- *)
- val get : ('a, exn) t -> 'a
-
--(** [default d r] evaluates to [d] if [r] is [Bad] else [x] when [r] is
-+(** [default d r] evaluates to [d] if [r] is [Error] else [x] when [r] is
- [Ok x]
- @since 2.0
- *)
- val default: 'a -> ('a, _) t -> 'a
-
--(** [map_default d f r] evaluates to [d] if [r] is [Bad] else [f x]
-+(** [map_default d f r] evaluates to [d] if [r] is [Error] else [f x]
- when [r] is [Ok x]
- @since 2.0
- *)
-@@ -49,12 +49,12 @@ val map_default : 'b -> ('a -> 'b) -> ('a, _) t -> 'b
- *)
- val is_ok : ('a, 'b) t -> bool
-
--(** [is_bad (Bad _)] is [true], otherwise [false]
-+(** [is_bad (Error _)] is [true], otherwise [false]
- @since 2.0
- *)
- val is_bad : ('a, 'b) t -> bool
-
--(** [is_exn e1 r] is [true] iff [r] is [Bad e2] with [e1=e2] *)
-+(** [is_exn e1 r] is [true] iff [r] is [Error e2] with [e1=e2] *)
- val is_exn : exn -> ('a, exn) t -> bool
-
- (** Convert an [option] to a [result]
-@@ -96,5 +96,5 @@ module Infix : sig
- val ( >>= ): ('a, 'b) t -> ('a -> ('c, 'b) t) -> ('c, 'b) t
- end
-
--(** Print a result as Ok(x) or Bad(exn) *)
-+(** Print a result as Ok(x) or Error(exn) *)
- val print : ('b BatInnerIO.output -> 'a -> unit) -> 'b BatInnerIO.output -> ('a, exn) t -> unit
-diff --git a/src/batSys.mliv b/src/batSys.mliv
-index 510a661..add0b33 100644
---- a/src/batSys.mliv
-+++ b/src/batSys.mliv
-@@ -65,7 +65,8 @@ external getenv : string -> string = "caml_sys_getenv"
- external command : string -> int = "caml_sys_system_command"
- (** Execute the given shell command and return its exit code. *)
-
--external time : unit -> float = "caml_sys_time"
-+##V<4.3## external time : unit -> float = "caml_sys_time"
-+##V>=4.3## external time : unit -> (float [@unboxed]) = "caml_sys_time" "caml_sys_time_unboxed" [@@noalloc]
- (** Return the processor time, in seconds, used by the program
- since the beginning of execution. *)
-
-diff --git a/src/batUnix.mliv b/src/batUnix.mliv
-index 60a6ec4..069d63a 100644
---- a/src/batUnix.mliv
-+++ b/src/batUnix.mliv
-@@ -766,7 +766,8 @@ val create_process_env :
- (** {6 Symbolic links} *)
-
-
--val symlink : string -> string -> unit
-+##V>=4.3##val symlink : ?to_dir:bool -> string -> string -> unit
-+##V<4.3##val symlink : string -> string -> unit
- (** [symlink source dest] creates the file [dest] as a symbolic link
- to the file [source]. *)
-
diff --git a/dev-ml/batteries/files/oc43-2.patch b/dev-ml/batteries/files/oc43-2.patch
deleted file mode 100644
index 36d8e41..00000000
--- a/dev-ml/batteries/files/oc43-2.patch
+++ /dev/null
@@ -1,344 +0,0 @@
-commit 905cbb6a3ebf1edc11745737feeedd36708149a7
-Author: KC Sivaramakrishnan <sk826@cl.cam.ac.uk>
-Date: Wed Mar 23 10:11:46 2016 +0000
-
- Spacing edits
-
-diff --git a/src/batGc.mli b/src/batGc.mli
-index ecffb79..494b9b1 100644
---- a/src/batGc.mli
-+++ b/src/batGc.mli
-@@ -34,18 +34,18 @@
- type stat = Gc.stat =
- { minor_words : float;
- (** Number of words allocated in the minor heap since
-- the program was started. This number is accurate in
-- byte-code programs, but only an approximation in programs
-- compiled to native code. *)
-+ the program was started. This number is accurate in
-+ byte-code programs, but only an approximation in programs
-+ compiled to native code. *)
-
- promoted_words : float;
- (** Number of words allocated in the minor heap that
-- survived a minor collection and were moved to the major heap
-- since the program was started. *)
-+ survived a minor collection and were moved to the major heap
-+ since the program was started. *)
-
- major_words : float;
- (** Number of words allocated in the major heap, including
-- the promoted words, since the program was started. *)
-+ the promoted words, since the program was started. *)
-
- minor_collections : int;
- (** Number of minor collections since the program was started. *)
-@@ -62,7 +62,7 @@ type stat = Gc.stat =
-
- live_words : int;
- (** Number of words of live data in the major heap, including the header
-- words. *)
-+ words. *)
-
- live_blocks : int;
- (** Number of live blocks in the major heap. *)
-@@ -78,8 +78,8 @@ type stat = Gc.stat =
-
- fragments : int;
- (** Number of wasted words due to fragmentation. These are
-- 1-words free blocks placed between two live blocks. They
-- are not available for allocation. *)
-+ 1-words free blocks placed between two live blocks. They
-+ are not available for allocation. *)
-
- compactions : int;
- (** Number of heap compactions since the program was started. *)
-@@ -92,16 +92,16 @@ type stat = Gc.stat =
- }
- (** The memory management counters are returned in a [stat] record.
-
-- The total amount of memory allocated by the program since it was started
-- is (in words) [minor_words + major_words - promoted_words]. Multiply by
-- the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
-- the number of bytes.
-+ The total amount of memory allocated by the program since it was started
-+ is (in words) [minor_words + major_words - promoted_words]. Multiply by
-+ the word size (4 on a 32-bit machine, 8 on a 64-bit machine) to get
-+ the number of bytes.
- *)
-
- type control = Gc.control =
- { mutable minor_heap_size : int;
- (** The size (in words) of the minor heap. Changing
-- this parameter will trigger a minor collection. Default: 256k. *)
-+ this parameter will trigger a minor collection. Default: 256k. *)
-
- mutable major_heap_increment : int;
- (** How much to add to the major heap when increasing it. If this
-@@ -112,45 +112,45 @@ type control = Gc.control =
-
- mutable space_overhead : int;
- (** The major GC speed is computed from this parameter.
-- This is the memory that will be "wasted" because the GC does not
-- immediatly collect unreachable blocks. It is expressed as a
-- percentage of the memory used for live data.
-- The GC will work more (use more CPU time and collect
-- blocks more eagerly) if [space_overhead] is smaller.
-- Default: 80. *)
-+ This is the memory that will be "wasted" because the GC does not
-+ immediatly collect unreachable blocks. It is expressed as a
-+ percentage of the memory used for live data.
-+ The GC will work more (use more CPU time and collect
-+ blocks more eagerly) if [space_overhead] is smaller.
-+ Default: 80. *)
-
- mutable verbose : int;
- (** This value controls the GC messages on standard error output.
-- It is a sum of some of the following flags, to print messages
-- on the corresponding events:
-- - [0x001] Start of major GC cycle.
-- - [0x002] Minor collection and major GC slice.
-- - [0x004] Growing and shrinking of the heap.
-- - [0x008] Resizing of stacks and memory manager tables.
-- - [0x010] Heap compaction.
-- - [0x020] Change of GC parameters.
-- - [0x040] Computation of major GC slice size.
-- - [0x080] Calling of finalisation functions.
-- - [0x100] Bytecode executable and shared library search at start-up.
-- - [0x200] Computation of compaction-triggering condition.
-- - [0x400] Output GC statistics at program exit.
-- Default: 0. *)
-+ It is a sum of some of the following flags, to print messages
-+ on the corresponding events:
-+ - [0x001] Start of major GC cycle.
-+ - [0x002] Minor collection and major GC slice.
-+ - [0x004] Growing and shrinking of the heap.
-+ - [0x008] Resizing of stacks and memory manager tables.
-+ - [0x010] Heap compaction.
-+ - [0x020] Change of GC parameters.
-+ - [0x040] Computation of major GC slice size.
-+ - [0x080] Calling of finalisation functions.
-+ - [0x100] Bytecode executable and shared library search at start-up.
-+ - [0x200] Computation of compaction-triggering condition.
-+ - [0x400] Output GC statistics at program exit.
-+ Default: 0. *)
-
- mutable max_overhead : int;
- (** Heap compaction is triggered when the estimated amount
-- of "wasted" memory is more than [max_overhead] percent of the
-- amount of live data. If [max_overhead] is set to 0, heap
-- compaction is triggered at the end of each major GC cycle
-- (this setting is intended for testing purposes only).
-- If [max_overhead >= 1000000], compaction is never triggered.
-- If compaction is permanently disabled, it is strongly suggested
-- to set [allocation_policy] to 1.
-- Default: 500. *)
-+ of "wasted" memory is more than [max_overhead] percent of the
-+ amount of live data. If [max_overhead] is set to 0, heap
-+ compaction is triggered at the end of each major GC cycle
-+ (this setting is intended for testing purposes only).
-+ If [max_overhead >= 1000000], compaction is never triggered.
-+ If compaction is permanently disabled, it is strongly suggested
-+ to set [allocation_policy] to 1.
-+ Default: 500. *)
-
- mutable stack_limit : int;
- (** The maximum size of the stack (in words). This is only
-- relevant to the byte-code runtime, as the native code runtime
-- uses the operating system's stack. Default: 1024k. *)
-+ relevant to the byte-code runtime, as the native code runtime
-+ uses the operating system's stack. Default: 1024k. *)
-
- mutable allocation_policy : int;
- (** The policy used for allocating in the heap. Possible
-@@ -173,8 +173,8 @@ type control = Gc.control =
-
- external stat : unit -> stat = "caml_gc_stat"
- (** Return the current values of the memory management counters in a
-- [stat] record. This function examines every heap block to get the
-- statistics. *)
-+ [stat] record. This function examines every heap block to get the
-+ statistics. *)
-
- external quick_stat : unit -> stat = "caml_gc_quick_stat"
- (** Same as [stat] except that [live_words], [live_blocks], [free_words],
-@@ -191,7 +191,7 @@ external get : unit -> control = "caml_gc_get"
-
- external set : control -> unit = "caml_gc_set"
- (** [set r] changes the GC parameters according to the [control] record [r].
-- The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
-+ The normal usage is: [Gc.set { (Gc.get()) with Gc.verbose = 0x00d }] *)
-
- external minor : unit -> unit = "caml_gc_minor"
- (** Trigger a minor collection. *)
-@@ -210,21 +210,21 @@ external major : unit -> unit = "caml_gc_major"
-
- external full_major : unit -> unit = "caml_gc_full_major"
- (** Do a minor collection, finish the current major collection cycle,
-- and perform a complete new cycle. This will collect all currently
-- unreachable blocks. *)
-+ and perform a complete new cycle. This will collect all currently
-+ unreachable blocks. *)
-
- external compact : unit -> unit = "caml_gc_compaction"
- (** Perform a full major collection and compact the heap. Note that heap
-- compaction is a lengthy operation. *)
-+ compaction is a lengthy operation. *)
-
- val print_stat : _ BatInnerIO.output -> unit
- (** Print the current values of the memory management counters (in
-- human-readable form) into the channel argument. *)
-+ human-readable form) into the channel argument. *)
-
- val allocated_bytes : unit -> float
- (** Return the total number of bytes allocated since the program was
-- started. It is returned as a [float] to avoid overflow problems
-- with [int] on 32-bit machines. *)
-+ started. It is returned as a [float] to avoid overflow problems
-+ with [int] on 32-bit machines. *)
-
- external get_minor_free : unit -> int = "caml_get_minor_free" [@@noalloc]
- (** Return the current size of the free space inside the minor heap. *)
-@@ -247,63 +247,63 @@ external huge_fallback_count : unit -> int = "caml_gc_huge_fallback_count"
-
- val finalise : ('a -> unit) -> 'a -> unit
- (** [finalise f v] registers [f] as a finalisation function for [v].
-- [v] must be heap-allocated. [f] will be called with [v] as
-- argument at some point between the first time [v] becomes unreachable
-- (including through weak pointers) and the time [v] is collected by
-- the GC. Several functions can
-- be registered for the same value, or even several instances of the
-- same function. Each instance will be called once (or never,
-- if the program terminates before [v] becomes unreachable).
--
-- The GC will call the finalisation functions in the order of
-- deallocation. When several values become unreachable at the
-- same time (i.e. during the same GC cycle), the finalisation
-- functions will be called in the reverse order of the corresponding
-- calls to [finalise]. If [finalise] is called in the same order
-- as the values are allocated, that means each value is finalised
-- before the values it depends upon. Of course, this becomes
-- false if additional dependencies are introduced by assignments.
--
-- In the presence of multiple OCaml threads it should be assumed that
-- any particular finaliser may be executed in any of the threads.
--
-- Anything reachable from the closure of finalisation functions
-- is considered reachable, so the following code will not work
-- as expected:
-- - [ let v = ... in Gc.finalise (fun _ -> ...v...) v ]
--
-- Instead you should make sure that [v] is not in the closure of
-- the finalisation function by writing:
-- - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
--
--
-- The [f] function can use all features of OCaml, including
-- assignments that make the value reachable again. It can also
-- loop forever (in this case, the other
-- finalisation functions will not be called during the execution of f,
-- unless it calls [finalise_release]).
-- It can call [finalise] on [v] or other values to register other
-- functions or even itself. It can raise an exception; in this case
-- the exception will interrupt whatever the program was doing when
-- the function was called.
--
--
-- [finalise] will raise [Invalid_argument] if [v] is not
-- guaranteed to be heap-allocated. Some examples of values that are not
-- heap-allocated are integers, constant constructors, booleans,
-- the empty array, the empty list, the unit value. The exact list
-- of what is heap-allocated or not is implementation-dependent.
-- Some constant values can be heap-allocated but never deallocated
-- during the lifetime of the program, for example a list of integer
-- constants; this is also implementation-dependent.
-- Note that values of types [float] and ['a lazy] (for any ['a]) are
-- sometimes allocated and sometimes not, so finalising them is unsafe,
-- and [finalise] will also raise [Invalid_argument] for them.
--
--
-- The results of calling {!String.make}, {!Bytes.make}, {!Bytes.create},
-- {!Array.make}, and {!Pervasives.ref} are guaranteed to be
-- heap-allocated and non-constant except when the length argument is [0].
-+ [v] must be heap-allocated. [f] will be called with [v] as
-+ argument at some point between the first time [v] becomes unreachable
-+ (including through weak pointers) and the time [v] is collected by
-+ the GC. Several functions can
-+ be registered for the same value, or even several instances of the
-+ same function. Each instance will be called once (or never,
-+ if the program terminates before [v] becomes unreachable).
-+
-+ The GC will call the finalisation functions in the order of
-+ deallocation. When several values become unreachable at the
-+ same time (i.e. during the same GC cycle), the finalisation
-+ functions will be called in the reverse order of the corresponding
-+ calls to [finalise]. If [finalise] is called in the same order
-+ as the values are allocated, that means each value is finalised
-+ before the values it depends upon. Of course, this becomes
-+ false if additional dependencies are introduced by assignments.
-+
-+ In the presence of multiple OCaml threads it should be assumed that
-+ any particular finaliser may be executed in any of the threads.
-+
-+ Anything reachable from the closure of finalisation functions
-+ is considered reachable, so the following code will not work
-+ as expected:
-+ - [ let v = ... in Gc.finalise (fun _ -> ...v...) v ]
-+
-+ Instead you should make sure that [v] is not in the closure of
-+ the finalisation function by writing:
-+ - [ let f = fun x -> ... ;; let v = ... in Gc.finalise f v ]
-+
-+
-+ The [f] function can use all features of OCaml, including
-+ assignments that make the value reachable again. It can also
-+ loop forever (in this case, the other
-+ finalisation functions will not be called during the execution of f,
-+ unless it calls [finalise_release]).
-+ It can call [finalise] on [v] or other values to register other
-+ functions or even itself. It can raise an exception; in this case
-+ the exception will interrupt whatever the program was doing when
-+ the function was called.
-+
-+
-+ [finalise] will raise [Invalid_argument] if [v] is not
-+ guaranteed to be heap-allocated. Some examples of values that are not
-+ heap-allocated are integers, constant constructors, booleans,
-+ the empty array, the empty list, the unit value. The exact list
-+ of what is heap-allocated or not is implementation-dependent.
-+ Some constant values can be heap-allocated but never deallocated
-+ during the lifetime of the program, for example a list of integer
-+ constants; this is also implementation-dependent.
-+ Note that values of types [float] and ['a lazy] (for any ['a]) are
-+ sometimes allocated and sometimes not, so finalising them is unsafe,
-+ and [finalise] will also raise [Invalid_argument] for them.
-+
-+
-+ The results of calling {!String.make}, {!Bytes.make}, {!Bytes.create},
-+ {!Array.make}, and {!Pervasives.ref} are guaranteed to be
-+ heap-allocated and non-constant except when the length argument is [0].
- *)
-
- val finalise_release : unit -> unit
-@@ -313,15 +313,15 @@ val finalise_release : unit -> unit
-
- type alarm = Gc.alarm
- (** An alarm is a piece of data that calls a user function at the end of
-- each major GC cycle. The following functions are provided to create
-- and delete alarms. *)
-+ each major GC cycle. The following functions are provided to create
-+ and delete alarms. *)
-
- val create_alarm : (unit -> unit) -> alarm
- (** [create_alarm f] will arrange for [f] to be called at the end of each
-- major GC cycle, starting with the current cycle or the next one.
-- A value of type [alarm] is returned that you can
-- use to call [delete_alarm]. *)
-+ major GC cycle, starting with the current cycle or the next one.
-+ A value of type [alarm] is returned that you can
-+ use to call [delete_alarm]. *)
-
- val delete_alarm : alarm -> unit
- (** [delete_alarm a] will stop the calls to the function associated
-- to [a]. Calling [delete_alarm a] again has no effect. *)
-+ to [a]. Calling [delete_alarm a] again has no effect. *)
diff --git a/dev-ml/batteries/files/oc43-3.patch b/dev-ml/batteries/files/oc43-3.patch
deleted file mode 100644
index 95fa8fa..00000000
--- a/dev-ml/batteries/files/oc43-3.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-commit 39393f8fc2d7c60dc093e9ea836077598dfbe955
-Author: KC Sivaramakrishnan <sk826@cl.cam.ac.uk>
-Date: Wed Mar 23 11:23:26 2016 +0000
-
- Fix make_float versioning
-
-diff --git a/src/batArray.mliv b/src/batArray.mliv
-index 025887f..c6bfd02 100644
---- a/src/batArray.mliv
-+++ b/src/batArray.mliv
-@@ -82,7 +82,9 @@ external make : int -> 'a -> 'a array = "caml_make_vect"
- If the value of [x] is a floating-point number, then the maximum
- size is only [Sys.max_array_length / 2].*)
-
--val make_float : int -> float array
-+##V>=4.3##val make_float : int -> float array
-+##V=4.2##external make_float : int -> float array = "caml_make_float_vect"
-+##V<4.2##val make_float : int -> float array
- (** [Array.make_float n] returns a fresh float array of length [n],
- with uninitialized data.
-
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-ml/batteries/, dev-ml/batteries/files/
@ 2017-03-27 13:59 Alexis Ballier
0 siblings, 0 replies; 4+ messages in thread
From: Alexis Ballier @ 2017-03-27 13:59 UTC (permalink / raw
To: gentoo-commits
commit: 7a3c37c979437f1267fac04617e69b96cc86fa6f
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 27 13:40:49 2017 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Mon Mar 27 13:59:25 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a3c37c9
dev-ml/batteries: Fix build with ocaml 4.05
Package-Manager: Portage-2.3.5, Repoman-2.3.2
dev-ml/batteries/batteries-2.5.3.ebuild | 8 ++-
dev-ml/batteries/files/ocaml405.patch | 92 +++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+), 2 deletions(-)
diff --git a/dev-ml/batteries/batteries-2.5.3.ebuild b/dev-ml/batteries/batteries-2.5.3.ebuild
index 74e5c5a448e..3190fe9cecc 100644
--- a/dev-ml/batteries/batteries-2.5.3.ebuild
+++ b/dev-ml/batteries/batteries-2.5.3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
-inherit oasis
+inherit oasis eutils
DESCRIPTION="The community-maintained foundation library for your OCaml projects"
HOMEPAGE="https://github.com/ocaml-batteries-team/batteries-included/"
@@ -21,3 +21,7 @@ DEPEND="${RDEPEND}
DOCS=( "ChangeLog" "FAQ" "README.folders" "README.md" )
S="${WORKDIR}/${PN}-included-${PV}"
+
+src_prepare() {
+ has_version '>=dev-lang/ocaml-4.05_beta' && epatch "${FILESDIR}/ocaml405.patch"
+}
diff --git a/dev-ml/batteries/files/ocaml405.patch b/dev-ml/batteries/files/ocaml405.patch
new file mode 100644
index 00000000000..e5016ee0a3c
--- /dev/null
+++ b/dev-ml/batteries/files/ocaml405.patch
@@ -0,0 +1,92 @@
+Index: batteries-included-2.5.3/src/batGc.mliv
+===================================================================
+--- batteries-included-2.5.3.orig/src/batGc.mliv
++++ batteries-included-2.5.3/src/batGc.mliv
+@@ -182,7 +182,7 @@ external counters : unit -> float * floa
+ is as fast at [quick_stat]. *)
+
+ ##V>=4.4##external minor_words : unit -> (float [@unboxed])
+-##V>=4.4## = "caml_gc_minor_words" "caml_gc_minor_words_unboxed" [@@noalloc]
++##V>=4.4## = "caml_gc_minor_words" "caml_gc_minor_words_unboxed"
+ ##V>=4.4##(** Number of words allocated in the minor heap since the program was
+ ##V>=4.4## started. This number is accurate in byte-code programs, but only an
+ ##V>=4.4## approximation in programs compiled to native code.
+@@ -227,7 +227,7 @@ val allocated_bytes : unit -> float
+ started. It is returned as a [float] to avoid overflow problems
+ with [int] on 32-bit machines. *)
+
+-##V>=4.3##external get_minor_free : unit -> int = "caml_get_minor_free" [@@noalloc]
++##V>=4.3##external get_minor_free : unit -> int = "caml_get_minor_free"
+ (** Return the current size of the free space inside the minor heap.
+ @since 2.5.0 and OCaml 4.03.0 *)
+
+Index: batteries-included-2.5.3/src/batInnerWeaktbl.ml
+===================================================================
+--- batteries-included-2.5.3.orig/src/batInnerWeaktbl.ml
++++ batteries-included-2.5.3/src/batInnerWeaktbl.ml
+@@ -107,6 +107,7 @@ module Make (H: Hashtbl.HashedType) : Ha
+ try ignore (Stack.pop (W.find tbl (dummy key))) with Not_found -> ()
+ let replace tbl key data = remove tbl key; add tbl key data
+ let mem tbl key = try ignore (find tbl key); true with Not_found -> false
++ let find_opt tbl key = if mem tbl key then Some(find tbl key) else None
+ let iter f tbl =
+ let f' (bk,v) = match unbox bk with Some k -> f k (obj v) | None -> () in
+ W.iter (Stack.iter f') tbl
+Index: batteries-included-2.5.3/src/batUnix.mliv
+===================================================================
+--- batteries-included-2.5.3.orig/src/batUnix.mliv
++++ batteries-included-2.5.3/src/batUnix.mliv
+@@ -272,6 +272,8 @@ type open_flag = Unix.open_flag =
+ ##V>=4.1## descriptor returned by {!openfile}
+ ##V>=4.1##
+ ##V>=4.1## Since OCaml 4.1 *)
++##V>=4.5## | O_KEEPEXEC (** Clear the close-on-exec flag.
++##V>=4.5## This is currently the default. *)
+ (** The flags to {!Unix.openfile}. *)
+
+
+@@ -546,11 +548,11 @@ val access : string -> access_permission
+ (** {6 Operations on file descriptors} *)
+
+
+-val dup : file_descr -> file_descr
++val dup : ?cloexec:bool -> file_descr -> file_descr
+ (** Return a new file descriptor referencing the same file as
+ the given descriptor. *)
+
+-val dup2 : file_descr -> file_descr -> unit
++val dup2 : ?cloexec:bool -> file_descr -> file_descr -> unit
+ (** [dup2 fd1 fd2] duplicates [fd1] to [fd2], closing [fd2] if already
+ opened. *)
+
+@@ -615,7 +617,7 @@ val closedir : dir_handle -> unit
+
+ (** {6 Pipes and redirections} *)
+
+-val pipe : unit -> file_descr * file_descr
++val pipe : ?cloexec:bool -> unit -> file_descr * file_descr
+ (** Create a pipe. The first component of the result is opened
+ for reading, that's the exit to the pipe. The second component is
+ opened for writing, that's the entrance to the pipe. *)
+@@ -1151,7 +1153,7 @@ type sockaddr = Unix.sockaddr =
+ domain; [addr] is the Internet address of the machine, and
+ [port] is the port number. *)
+
+-val socket : socket_domain -> socket_type -> int -> file_descr
++val socket : ?cloexec:bool -> socket_domain -> socket_type -> int -> file_descr
+ (** Create a new socket in the given domain, and with the
+ given kind. The third argument is the protocol type; 0 selects
+ the default protocol for that kind of sockets. *)
+@@ -1160,10 +1162,10 @@ val domain_of_sockaddr: sockaddr -> sock
+ (** Return the socket domain adequate for the given socket address. *)
+
+ val socketpair :
+- socket_domain -> socket_type -> int -> file_descr * file_descr
++ ?cloexec:bool -> socket_domain -> socket_type -> int -> file_descr * file_descr
+ (** Create a pair of unnamed sockets, connected together. *)
+
+-val accept : file_descr -> file_descr * sockaddr
++val accept : ?cloexec:bool -> file_descr -> file_descr * sockaddr
+ (** Accept connections on the given socket. The returned descriptor
+ is a socket connected to the client; the returned address is
+ the address of the connecting client. *)
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-27 13:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 9:14 [gentoo-commits] repo/gentoo:master commit in: dev-ml/batteries/, dev-ml/batteries/files/ Alexis Ballier
-- strict thread matches above, loose matches on Subject: below --
2017-03-27 13:59 Alexis Ballier
2017-01-24 10:55 Alexis Ballier
2016-02-09 8:45 Alexis Ballier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox