Commit Graph

20284 Commits (bdd9ca391e3a56253d7480b07bb1a8aac361904c)

Author SHA1 Message Date
Stephen Dolan 2d92955749
Remove Const_pointer (#9578)
Since #9316 was merged, Cconst_pointer is compiled in exactly the same way as Cconst_int. This commit removes the now-redundant Cconst_pointer and Cconst_natpointer.
2020-05-19 15:31:08 +02:00
Jeremy Yallop 8ce5231e3b Fix Changes formatting (tabs, line length). 2020-05-19 10:17:35 +01:00
KC Sivaramakrishnan bd1b4b7a41
Add a header macro for out-of-heap blocks (#9564)
It can be used to construct statically-allocated, out-of-heap blocks that the GC will not traverse.
2020-05-19 11:07:26 +02:00
Stephen Dolan 6b214f5138 Ensure stdlib documentation index refers to Stdlib
Previously, some references were to Pervasives and some were missing.
2020-05-18 19:15:05 +01:00
Gabriel Scherer 7fa87c04b0
Merge pull request #9576 from xavierleroy/doc-digest
Update documentation of Digest module
2020-05-18 19:17:14 +02:00
Florian Angeletti 39954596fe
Merge pull request #9567 from Octachron/flatten_fields_comment
#5428: import comment on flatten_fields
2020-05-18 16:23:18 +02:00
Gabriel Scherer 5b2c687ddc typo fix 2020-05-18 15:29:16 +02:00
Gabriel Scherer 17dcf49610 please check-typo despite all the sand 2020-05-18 15:15:04 +02:00
octachron 9fe4b963cb import Jacques comment on flatten_fields from the issue tracker 2020-05-18 11:37:40 +02:00
Xavier Leroy 5890df0ad1 Update documentation of Digest module
State more clearly that MD5 is not cryptographically secure.
2020-05-18 11:33:06 +02:00
Florian Angeletti faec2de1d6
Merge pull request #9566 from Octachron/testsuite_aliases_and_applicative_functors
tests: aliases and applicative functors
2020-05-18 10:57:29 +02:00
Nicolás Ojeda Bär 7bf6a78427 Changes 2020-05-18 09:33:15 +02:00
Nicolás Ojeda Bär d18d552fdc
Add Unix.is_inet6_addr (#9575)
Closes: #4535
Closes: #6105
2020-05-18 09:32:00 +02:00
Gabriel Scherer 7e55af1cbd
Merge pull request #9571 from gadmm/stdlib-global-races
Make at_exit and Printexc.register_printer thread-safe
2020-05-17 07:06:04 +02:00
Guillaume Munch-Maccagnoni 1e4eea19ef Make at_exit forward-compatible with multicore 2020-05-16 22:58:07 +02:00
Guillaume Munch-Maccagnoni a469b4d0af Implement at_exit with Atomics
Atomic becomes a dependency of Stdlib
2020-05-16 22:58:07 +02:00
Guillaume Munch-Maccagnoni abe982165b Fix data race in at_exit and Printexc.register_printer with systhreads 2020-05-16 22:57:34 +02:00
Gabriel Scherer b42541395c Travis CheckDepend: show the difference, not just the problematic files
(No change entry needed)
2020-05-16 22:44:12 +02:00
Gabriel Scherer c20fc10ac2
Merge pull request #9570 from gasche/atomic
stdlib: provide a sequential implementation of the Atomic module from Multicore
2020-05-16 20:07:42 +02:00
Xavier Leroy 43f7a263b3 A lightweight variant of the Inria CI script "main"
Tries to build just what's needed to run the test suite.
2020-05-16 19:40:14 +02:00
Gabriel Scherer 4c05c9d8db fix the manual and improve the check-stdlib-modules error message 2020-05-16 17:51:54 +02:00
Gabriel Scherer c544d640b6 fix the testsuite (and add -dno-unique-ids where reasonable) 2020-05-16 17:51:54 +02:00
Gabriel Scherer 04d9c425f3 stdlib: provide a sequential interface of the Atomic module from OCaml Multicore
This module provides a purely sequential implementation of the
concurrent atomic references provided by the Multicore OCaml
standard library:

https://github.com/ocaml-multicore/ocaml-multicore/blob/parallel_minor_gc/stdlib/atomic.mli

This sequential implementation is provided in the interest of
compatibility: when people will start writing code to run on
Multicore, it would be nice if their use of Atomic was
backward-compatible with older versions of OCaml without having to
import additional compatibility layers. *)
2020-05-16 17:51:54 +02:00
Gabriel Scherer 9ca2a352c8 make check-typo happy 2020-05-16 12:32:49 +02:00
Gabriel Scherer 3851022244
Merge pull request #9568 from garrigue/fix5987
Fix5987
2020-05-15 20:58:26 +02:00
Sébastien Briais f52fdc2068
Define to_rev_seq in Set and Map module (#9075) 2020-05-15 17:38:45 +02:00
Jacques Garrigue a2a287c823 like classes, type constraints are 'typexpr = typexpr' 2020-05-15 15:48:57 +02:00
octachron c991225652 tests: aliases and applicative functors
* Enable the full test for 3476
* add the 5058 example
2020-05-15 11:02:05 +02:00
Xavier Leroy 914dd057b5
win32unix: quote the arguments to the Unix.exec* functions (#9550)
Otherwise, arguments get split at spaces.
This is the same quoting that the Win32 implementation of
Unix.create_process does.

A test was added.

Fixes: 9320
2020-05-14 18:15:10 +02:00
Florian Angeletti 1a8a4dfd85
Merge pull request #9552 from Octachron/forgotten_ocamloptp
Restore ocamloptp
2020-05-14 16:10:05 +02:00
Gabriel Scherer 229df94da5 Changes 2020-05-14 10:28:42 +02:00
Gabriel Scherer 68dc87c9e9 matching: use pattern views in Parmatch as well 2020-05-14 10:27:50 +02:00
Gabriel Scherer e19a3afcb4 matching: move {general,simple,half_simple}_view to Patterns 2020-05-14 10:27:15 +02:00
Gabriel Scherer 4d6267d3ba matching: move (Non_empty_row, views, General) to patterns.ml 2020-05-14 10:26:01 +02:00
Gabriel Scherer 0e979b7ea9 patterns: reuse ('a Typedtree.pattern_) to define Patterns.Head.t 2020-05-14 10:26:01 +02:00
Gabriel Scherer f5f4ba67a9 matching: separate types for rows and clauses
"rows" are common abstraction of both pattern analysis and
compilation, but clauses carrying a Lambda.t term are
compilation-specific. Separating rows will thus enable moving more
logic to typing/patterns for use in both settings.
2020-05-14 10:16:34 +02:00
Gabriel Scherer 54b79d3b27 [minor] matching: rename Non_empty_clause.{map_head => map_first} 2020-05-14 10:13:02 +02:00
octachron 0963b0c6b6 Restore ocamloptp 2020-05-14 10:11:42 +02:00
Thomas Refis e880ec3323 make depend 2020-05-14 10:11:36 +02:00
Gabriel Scherer ffb6caef8b patterns: move Parmatch.Pattern_head into Patterns.Head
The aim is to also move the Simple/Half_simple/General stuff from
matching, but we need to split in those modules the part that are
purely structural (they go in Patterns) and the parts that are
actually compilation logic (Half_simple.of_clause), those stay in
Matching.
2020-05-14 10:11:36 +02:00
Gabriel Scherer b3434751e2
Merge pull request #9520 from trefis/rematch-make_matching-cleanup
pattern-matching refactoring: refactor the `make_<foo>_matching` functions
2020-05-14 09:21:07 +02:00
Nicolás Ojeda Bär 153eee9678
Merge pull request #9554 from nojb/__SCOPE__
Add primitive __FUNCTION__ that returns the name of current scope
2020-05-14 00:01:07 +02:00
Nicolás Ojeda Bär ea835ee45e Changes 2020-05-13 20:57:21 +02:00
Nicolás Ojeda Bär f3e6d27e30 Add test 2020-05-13 20:57:21 +02:00
Nicolás Ojeda Bär 4a44bf1767 Expose %loc_FUNCTION as __FUNCTION__ 2020-05-13 20:57:21 +02:00
Nicolás Ojeda Bär 6e3f710d78 Bootstrap 2020-05-13 20:57:18 +02:00
Nicolás Ojeda Bär 4e33dcf35f Add %loc_FUNCTION primitive 2020-05-13 20:49:01 +02:00
Xavier Leroy c17f6c2956
Protect against bad rounding of mtime / atime / ctime stats (#9505)
Some file systems maintain time stamps with sub-second resolution, up
to nanosecond resolution.  When converting from a "(seconds, nanoseconds)"
timestamp to a floating-point timestamp, rounding to nearest can produce
"seconds + 1" as a result, i.e. the integer part of the FP timestamp
is not equal to "seconds".  As described in #9490, this is a problem
in some cases.

This commit implements a more careful conversion of "(seconds,
nanoseconds)" pairs to FP timestamps so that the integer part of the
FP result is always "seconds".

Both the otherlibs/unix and the otherlibs/win32unix implementations are affected
and corrected.

Closes: #9490
2020-05-13 18:43:46 +02:00
David Allsopp b6c8b35e2d
Make -flarge-toc the default for PowerPC (#9557)
Introduce -fsmall-toc in order to access the previous behaviour and
document both options in the manual and ocamlopt manpage.
2020-05-13 18:23:37 +02:00
Gabriel Scherer 065139617f matching: factorize the make_*_matching functions
Before, each head construction had a `make_<foo>_matching` construct that
was responsible for three things:
- consuming the argument from the argument list
  (the "argument" is a piece of lambda code to access
   the value of the current scrutinee)
- building arguments for the subpatterns of the scrutinee
  and pushing them to the argument list
- building a `cell` structure out of this, representing a head group
  during compilation

Only the second point is really specific to each construction.

This refactoring turns this second point into a construct-specific
`get_expr_args_<foo>` function (similarly to `get_pat_args_<foo>`),
and moves the first and third point to a generic `make_matching`
function.

Note: this commit contains a minor improvement to the location used to
force (lazy ..) arguments.
2020-05-13 17:18:08 +02:00