Commit Graph

1323 Commits (f15634f562f81fc5a548dc238b8b901b94c54721)

Author SHA1 Message Date
Xavier Leroy 20115917b2 PR#7457: double pthread_mutex_destroy on a I/O buffer mutex
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.
2017-01-12 11:42:09 +01:00
Leo White 69880ef241 Merge pull request #891 from lpw25/fno-builtin-memcmp
Use -fno-builtin-memcmp with gcc
2017-01-10 11:02:52 +00:00
Leo White a50fbd02e0 Add Changes entry 2017-01-10 10:13:31 +00:00
Leo White 796116d263 Add Changes entry 2017-01-10 10:09:08 +00:00
Jérémie Dimino 5ed72007f8 Deprecate Bigarray.*.map_file and add Unix.map_file (#997)
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.
2017-01-10 10:03:24 +00:00
alainfrisch 93afa012ec Take review comments into account. 2017-01-03 15:21:55 +01:00
alainfrisch c62296b063 Eliminate more useless computations when inlining
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.
2017-01-03 15:21:15 +01:00
Roma Sokolov 4da2b30b98 Adds missing functions to *Labels modules (#875)
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
```
2017-01-03 15:03:05 +01:00
Gabriel Scherer f8924436a3 Changes typo 2017-01-02 15:20:57 -05:00
Gabriel Scherer 239c054bee PR #881: explicit the Outcometree change that may affect compiler-libs users 2017-01-02 15:16:23 -05:00
Valentin Gatien-Baron da564daa0e adding Changes entry 2017-01-02 14:52:24 -05:00
Gabriel Scherer e97173d082 Code cleanups in asmcomp/s390x (#908) 2016-12-30 14:22:48 +00:00
Chunhui He 477dca5ce9 caml-types.el: Fix missing format argument
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.")
2016-12-30 05:02:55 +00:00
Gabriel Scherer 09d743a421 Merge pull request #990 from Octachron/open_pattern_unused_module_warning
MPR#7443: fix spurious "unused open" warnings in presence of local open in patterns
2016-12-29 10:33:08 -05:00
Gabriel Scherer 5b496d013c Merge pull request #991 from shindere/fix-windows-make-install
Fix ``make install' for the Windows build system
2016-12-29 08:35:14 -05:00
Gabriel Scherer bb0ed08ae8 Merge pull request #946 from gasche/raise_value
MPR#7423: `void caml_{failwith,invalid_argument}_value(value msg)`
2016-12-29 08:24:15 -05:00
Sébastien Hinderer d713e90075 Fix ``make install' for the Windows build system
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.
2016-12-29 11:41:38 +01:00
Mark Shinwell 8127e31125 Fix evaluation order for overapplications when using Closure (#967) 2016-12-29 08:34:11 +00:00
Nicolas Ojeda Bar ebaa7c1a44 Update Changes 2016-12-29 08:23:20 +05:30
octachron dc51e513e3 MPR#7443: pattern open, false unused open warning 2016-12-28 22:15:07 +01:00
Gabriel Scherer d324c21250 PR#7423, GPR#946: void caml_{failwith,invalid_argument}_value(value msg) 2016-12-28 10:59:30 -05:00
Gabriel Scherer 068745dc84 PR#5115: harden all byterun/fail.c exceptions against caml_global_data
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.)
2016-12-28 00:31:03 -05:00
Mark Shinwell d2281a2377 Fix Spacetime compilation (#984) 2016-12-27 12:39:41 +00:00
Mark Shinwell f20634493f Remove Istore_symbol (plus some Win64 fixes) (#955) 2016-12-27 12:30:12 +00:00
Gabriel Scherer b7ccc16af2 ocamldoc: keep using relative instead of absolute source file names
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.
2016-12-26 09:01:15 -05:00
Jacques Garrigue 94a1f38c32 Fix PR#7437 2016-12-26 16:55:43 +09:00
Anton Bachin defd5f6343 alloc_sockaddr: don't assume a null terminator
Some systems, macOS in particular, do not null-terminate Unix domain
socket paths returned by getsockname and other system calls.
2016-12-25 14:18:34 -06:00
Gabriel Scherer b72120e8e1 change entry for GPR#935 2016-12-23 16:57:07 -05:00
Yunxing Dai 22e89fc9cb Catch out_of_range in "list" command
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.
2016-12-23 16:31:26 -05:00
Gabriel Scherer d441367fa1 minor Changes update 2016-12-23 14:52:33 -05:00
Fabrice Le Fessant df546b92f5 Fix problem with ocamlopt.opt -plugin
Add NATDYNLINKOPTS options to ocamlbytecomp.cmxa
2016-12-23 14:49:30 -05:00
Alain Frisch 9dbcb1ec6c Improve compilation time for toplevel include(struct ... end : sig ... end) (#832)
* 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.
2016-12-21 14:38:41 +01:00
Gabriel Scherer e51cbef847 Merge pull request #934 from yallop/bytes-extend-overflow
Check for integer overflow in Bytes.extend
2016-12-19 09:51:30 -05:00
Jeremy Yallop a4b23e18e9 Add a changelog entry for Bytes.extend overflow check. 2016-12-19 14:18:57 +00:00
Alain Frisch 807928cc50 Merge pull request #915 from objmagic/more-pprintast-fix
more -dsource bug fix
2016-12-19 12:16:11 +01:00
Jacques Garrigue 6e694c6c7f Fix PR#7432 2016-12-17 10:36:56 +09:00
Gabriel Scherer d2abc9fb70 epipe: Changelog entry for #797 2016-12-15 21:48:32 -05:00
Gabriel Scherer d89b1a7b83 PR#7172: ocamlc -config: add int_size, word_size, ext_exe (#970) 2016-12-14 09:43:19 -05:00
Stephane Glondu 7c6c1f3624 objinfo: dump globals defined in bytecode executables 2016-12-14 08:44:55 -05:00
octachron ec269e6665 Add a changelog entry for GPR#592 2016-12-14 13:14:21 +00:00
Damien Doligez 144650a13d mark GPR#538 as non-breaking 2016-12-14 13:14:21 +00:00
David Allsopp 193c2ad023 Sync 4.04.0 Changes file 2016-12-14 13:14:21 +00:00
Pierre Chambart 2086589557 Update Changes and comment on potential improvements 2016-12-14 13:14:21 +00:00
Pierre Chambart faafef9ca4 Update Changes 2016-12-14 13:14:21 +00:00
Damien Doligez 8c99d22cc1 fix changelog for commit 4ab6b5ce77b7fa93fb7038fd3b97540dcb6a74c9 (PR#7368 instead of PR#7378) 2016-12-14 13:14:21 +00:00
Damien Doligez f7a05fb08a PR#7378: Manual major GC fails to compact the heap 2016-12-14 13:14:21 +00:00
Jacques Garrigue c4f208a573 Fix PR#7324 2016-12-14 13:14:21 +00:00
Jacques Garrigue 93fa17df8a add comment on the need of local type annotation for PR#7152 2016-12-14 13:14:21 +00:00
sliquister d8fc8dce4d MPR#7216: allow syntax Functor(val x) (#949)
* allow syntax Functor(val x)
* manual: mention the first-class module tweak
2016-12-13 17:23:53 +09:00
Jacques Garrigue d5eb7b8bf3 merge upstream 2016-12-10 11:36:32 +09:00