The mutex can be destroyed for the first time when finalizing the I/O buffer.
If the buffer contains unflushed data, it is kept in the list of buffers.
Then Unix.fork() causes caml_thread_reinitialize() to reset all buffers in
this list, destroying the mutex a second time.
To break the circular dependency between Bigarray and Unix, a CamlinternalBigarray module was added to the stdlib. This module defines all the types used by the compiler to produce optimized code for bigarrays.
Thanks to David Allsopp for fixing Windows tests.
When a function that ignores some of its parameters is inlined, the
corresponding arguments are still evaluated if they are not determined
to be "pure". This commit improves this purity criterion by reusing
an existing function that detects more cases. Only the non flambda
pipeline is adapted by this commit, but I guess the same optimization
is already part of flambda (CI will tell!) or would be easily added.
This fix makes it possible to use labeled modules as drop-in replacement with
`open StdLabels`.
Added signatures:
```ocaml
(* arrayLabels.mli *)
val iter2 : f:('a -> 'b -> unit) -> 'a array -> 'b array -> unit
val map2 : f:('a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array
(* bytesLabels.mli *)
val extend : bytes -> left:int -> right:int -> bytes
val blit_string :
val cat : bytes -> bytes -> bytes
val uppercase_ascii : bytes -> bytes
val lowercase_ascii : bytes -> bytes
val capitalize_ascii : bytes -> bytes
val uncapitalize_ascii : bytes -> bytes
val equal: t -> t -> bool
(* listLabels.mli *)
val compare_lengths : 'a list -> 'b list -> int
val compare_length_with : 'a list -> len:int -> int
val cons : 'a -> 'a list -> 'a list
(* moreLabels.Hashtbl *)
val is_randomized : unit -> bool
(* stringLabels.mli *)
val uppercase_ascii : string -> string
val lowercase_ascii : string -> string
val capitalize_ascii : string -> string
val uncapitalize_ascii : string -> string
val equal: t -> t -> bool
val split_on_char: sep:char -> string -> string list
```
Now the emacs mode can not show the kind of call at point. Emacs shows the
following message:
let: Wrong number of arguments: (lambda (info format) "Displays INFO using the given FORMAT." (message (format format info)) (save-current-buffer (set-buffer caml-types-buffer) (erase-buffer) (insert info))), 1
This issue was introduced in commit 5fa4e02. It extracted the feedback logic
to function caml-types-feedback, but deleted the format argument by accident.
So let's fix it.
Fixes: 5fa4e02 ("caml-types.el: Extract the feedback logic to a separate function.")
Before this commit, the installopt target was a prerequisite of the
install target. This means it was run even when the native compilers
were not compiled.
Thus, the sequence
make -f Makefile.nt world
make -f Makefile.nt install
failed before this commit.
This commit fixes this by running the installopt target only if ocamlopt
exists, as is done for the Unix build system. It also removes the
installbyt target.
In SVN commit 10793 ( git commit
f67d5c8de8d2d6f8ff526af12b01f84309abfbd2 ), the bytecode runtime
implementations of caml_{failwith,invalid_argument} were hardened to
work when caml_global_data was not yet initialized. This is required
as those exception-raising functions are called by demarshalling
routines in intern.c, and could be called from there during
caml_global_data initialization by the bytecode runtime.
However, the code of intern.c also contains calls to other
exception-raising functions such as, currently,
caml_raise_out_of_memory and caml_end_of_file. This change defensively
protects all accesses to caml_global_data in byterun/fail.c.
(Only the bytecode versions of caml_raise_* are changed, there is no
difference for the native runtime.)
The fact that ocamldoc uses absolute file paths in its error messages
creates a usability problem for ocamlbuild users that see the path of
the files in _build instead of the path of the files in the source
project. See <https://github.com/ocaml/ocamlbuild/issues/79>:
cd /tmp
mkdir repro; cd repro
echo "(** hey {ol {1 bla}} *)" > a.mli
echo "A" > doc.odocl
ocamlbuild doc.docdir/index.html
raises the error message:
> File "/tmp/repro/_build/a.mli", line 0, character 11:
> Error parsing text:
> hey {ol {1 bla}}
> ^
and then people jump to the reported error site from their editor, and
then they are editing temporary _build files and it is a mess.
After the patch is applied, we get the following error message instead:
> File "a.mli", line 0, character 11:
> Error parsing text:
> hey {ol {1 bla}}
> ^
The code that is removed by the patch is also a mess, of undocumented
assumptions. It is careful to Sys.chdir to the argument's directory,
and to capture a long name there and Sys.chdir back. This would make
perfect sense if other parts of ocamldoc were also using 'chdir' and
one could therefore not trust relative paths. But these were the only
two places using 'chdir', so the present change actually establishes
the property that relative paths can be trusted.
I am not imaginative enough to have a sense of what can go wrong as
we turn those absolute paths into relative paths. I looked at the
blame information, this code comes from the very first ocamldoc
commits by Maxence in 2002. My guess would be that early prototypes
used 'chdir' more agressively (maybe to call the typechecker as an
external command?), making absolute paths useful.
If you type list at a step where the source info is not available, ocamldebug could crash
due to the uncaught exception. This patch catches the exception and return an user friendy
error message instead.
* Improve compilation time for toplevel include(struct ... end : sig ... end)
This is intended to fix MPR#7357, which uses the natural way
of specifying an inline signature for a unit without using an external
.mli file.
The trick is similar than the one applied for compiling
module X = (struct ... end : sig ... end)
Identifiers of the inner structure are "lifted" as extra fields
to the top-level structure.
* Changelog.