Commit Graph

20751 Commits (c3f6cd7ff7d53a1b97651ad59d2c0c81f98751a8)

Author SHA1 Message Date
David Allsopp 0d4f1ba182 Guard caml_fatal_uncaught_exception with CAML_INTERNALS 2020-09-04 15:59:43 +01:00
David Allsopp c35dc17664 Guard heap functions with CAML_INTERNALS 2020-09-04 15:57:57 +01:00
David Allsopp b4fa324832 Explicit export caml_allocation_color 2020-09-04 15:54:52 +01:00
David Allsopp 0fce1e36ae Guard most of minor_gc.h with CAML_INTERNALS 2020-09-04 15:53:44 +01:00
David Allsopp eb6d803222 caml_gc_dispatch doesn't need exporting 2020-09-04 15:53:29 +01:00
David Allsopp ff7da588d6 Add missing caml_ prefix in minor_gc.h 2020-09-04 15:51:54 +01:00
David Allsopp bd58bcff8d Remove unimplemented functions in caml/alloc.h 2020-09-04 15:41:29 +01:00
David Allsopp bab2d10a68 Declare caml_*_ops in headers 2020-09-04 15:25:49 +01:00
Jeremy Yallop 44c053008a
Merge pull request #9066 from gasche/either
Add `('a, 'b)  Either.t = Left of 'a | Right of 'b` and `List.partition_map`
2020-09-03 22:47:55 +01:00
Gabriel Scherer de72be7c70 mention Either in the manual 2020-09-03 22:24:37 +02:00
Jeremy Yallop 1a8aa5428e Add partition_map to ListLabels. 2020-09-03 22:23:00 +02:00
Florian Angeletti ce04a5c1b1 Merge pull request #9862 from Octachron/4.11.1_with_less_daring_assertions
9859: revert 9348, inferred function types and :>
(cherry picked from commit 28b82e2e397d129840e35fb8da0b8af8b9f59633)
2020-09-03 13:55:17 +02:00
Florian Angeletti 66c368ae77 Merge pull request #9857 from lpw25/fix-poly-refs-check
Add missing `lower_contravariant` call (fixes #9856)

(cherry picked from commit 56707233fb6e33d0e5d0719b8550a15db8aa02d9)
2020-09-03 13:55:17 +02:00
Florian Angeletti a2ecfc45a3 Reorder changes, "language feature" section 2020-09-03 13:55:17 +02:00
Greta Yorsh 2bb2bde74c
Prologue size should not depend on stack_offset (power, arm64) (#9083)
* Prologue size does not depend on stack_offset (power, arm64)

Define `initial_stack_offset` of a function, independently
of stack_offset, and use it to compute both frame_size and
prologue_size.
2020-09-03 13:26:00 +02:00
Florian Angeletti 63972f9687
Fix injectivity test wrt value restriction (#9867)
The original test is rejected when the value restriction is properly implemented.
2020-09-03 11:09:35 +02:00
Gabriel Scherer ca6f3ee057 List.partition_map : (a -> (b, c) Either.t) -> a list -> b list * c list 2020-09-02 13:59:53 +02:00
Gabriel Scherer 25e59d63d8 Add `'a Either.t = Left of 'a | Right of 'b`
```ocaml
val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : left:('a1 -> 'a2) -> right:('b1 -> 'b2) -> ('a1, 'b1) t -> ('a2, 'b2) t
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'c
val equal :
  left:('a -> 'a -> bool) -> right:('b -> 'b -> bool) ->
  ('a, 'b) t -> ('a, 'b) t -> bool
val compare :
  left:('a -> 'a -> int) -> right:('b -> 'b -> int) ->
  ('a, 'b) t -> ('a, 'b) t -> int
```

Unlike [result], no [either] type is made available in Stdlib,
one needs to access [Either.t] explicitly:

- This type is less common in typical OCaml codebases,
  which prefer domain-specific variant types whose constructors
  carry more meaning.
- Adding this to Stdlib would raise warnings in existing codebases
  that already use a constructor named Left or Right:
  + when opening a module that exports such a name,
    warning 45 is raised
  + adding a second constructor of the same name in scope kicks
    in the disambiguation mechanisms, and warning 41 may now
    be raised by existing code.

If the use becomes more common in the future we can always
revisit this choice.
2020-09-02 13:59:53 +02:00
Gabriel Scherer 5cc12b8100
testsuite/tests/formatting: remove native-compiler location tests (#9871)
The tests for -dlocations are painful to update for native compiler
backends. They were previously restricted to 64bit architectures only
( e57785524b ), and disabled on AFL
( 829b00b6c7 ), but the fact that they
have to be updated for both clambda and flambda backends is annoying
in practice. This commit disables location-testing completely for the
native backend, and only checks locations in the bytecode compiler
intermediate representations, from -dparsetree to -dlambda.

Note: now the we have bytecode-only versions of the test, it should be
more portable. The test has been re-enabled for 32bit and AFL
configurations. It will still need tweaking in the future if people
perform configuration-dependent changes on the Lambda representation
(but hopefully those changes could be disabled by command-line options
to be added to the test configuration).
2020-09-02 11:41:20 +02:00
Yishuai Li 63c7071a34
Add Unix.SO_REUSEPORT (#9869)
Support the SO_REUSEPORT socket option.

Closes: #3512
2020-09-02 10:52:04 +02:00
Josh Berdine 169892a0d0 Use polymorphic compare to empty string instead of checking length for 0 2020-09-01 21:59:05 +01:00
Xavier Leroy 09f2b9dd57 Revised {in,out}_channel_length and seek_in for channels in text mode
Under Windows, for channels opened in text mode, EOL conversion causes
a mismatch between the `offset` position cached in the
`struct channel` record and actual position in the file.

This commit turns off the use of the cached "offset" in the implementations
of `{in,out}_channel_length` and `seek_in`, calling `lseek` directly instead.

To support this, a new channel flag `CHANNEL_TEXT_MODE` was added.  It
is set for channels operating in text mode under Windows, when EOL
conversion is active.

Fixes: #9868
2020-09-01 20:33:39 +02:00
Xavier Leroy 4066fbd69c Fix overflow detection in {in,out}_channel_length
The LargeFile version of these functions was incorrectly reporting
an error if the size is not representable as an OCaml unboxed int.
2020-09-01 20:26:35 +02:00
Xavier Leroy d356562d0f Test in_channel_length and seek_in on channels opened in text mode
Repro cases for #9868.
2020-09-01 20:26:29 +02:00
Xavier Leroy 34f20c7746 Update copyright years
Using an interval 1996-2020.

Fixes: #9834
2020-08-29 16:48:36 +02:00
Xavier Leroy 4c1654f135
z Systems: subtract immediate has its own range of valid immediate values (#9860)
Because it is turned into add immediate opposite in emit.mlp.
2020-08-26 09:23:44 +02:00
Stephen Dolan 41f0522df3
Use different symbol names for caml_do_local_roots on bytecode and native code (#9503) 2020-08-25 21:22:34 +01:00
Leo White ccf4df0758
Remove spurious Ptop_defs from #use (#9376)
* Remove spurious Ptop_defs from #use

* Add Changes entry
2020-08-25 18:01:03 +01:00
Stephen Dolan b735f187ac
Avoid Cconst_natint where Cconst_int will do (#9838)
Cconst_int generates better code, as it hits the instruction
selector's cases for small immediates.
2020-08-25 16:27:11 +01:00
Stephen Dolan 6e84a11181
Fix double free of toplevel bytecode (#9855) 2020-08-25 15:22:46 +01:00
Josh Berdine a69be67e33 Treat set-but-empty OCAMLPARAM the same as unset
In case the OCAMLPARAM environment variable is set to the empty
string, the current behavior is to attempt to parse it, which fails to
find the `_` character separating the "before" and "after"
settings. This patch changes this to treat OCAMLPARAM set to the empty
string the same as being unset, which is to do nothing.
2020-08-21 20:42:15 +01:00
Gabriel Scherer 7bbf612a9d
Merge pull request #9852 from yallop/runtop-toplevel
Add 'toplevel' directory to 'make runtop'.
2020-08-21 17:18:41 +02:00
Jeremy Yallop 86fe4bdead Add 'toplevel' directory to 'make runtop'. 2020-08-21 12:37:26 +01:00
Jeremy Yallop 491cc88b33 Mark Obj.tag [@@noalloc] 2020-08-21 10:29:31 +01:00
David Allsopp 781b37b688
Actually remove directories (#9849)
`rm_rf` removed the files (recursively) but not the directories.
2020-08-20 16:06:46 +02:00
Xavier Leroy 53fe14a541 channel_of.ml test: create temp file with O_SHARE_DELETE
Otherwise, under Win32, we can get an error on Sys.remove because
handles remain opened on the file.
2020-08-20 14:36:27 +02:00
Xavier Leroy de791aa113 Changes entry for #9753 2020-08-20 11:53:44 +02:00
David Allsopp fa577c377c
Merge pull request #9847 from dra27/no-configure
Don't display configure diffs in Pull Requests
2020-08-20 09:14:07 +01:00
David Allsopp 92ae58e9c1 Fix typo in configure.ac 2020-08-19 20:56:33 +01:00
David Allsopp 3325876e60 Don't display configure in GitHub diffs 2020-08-19 19:55:07 +01:00
hhugo 49aa87c316
Introduce warning 68 to warn about hidden allocation due to pattern match of mutable field in curried functions (#9751)
Introduce new warning 68
2020-08-17 09:47:36 +01:00
Sébastien Hinderer d9a3ad413f Notify only on regressions for Inria CI's other-configs job 2020-08-14 17:01:58 +02:00
Sébastien Hinderer 7b2689b8a0 Define Inria CI's other-configs job as a Jenkins pipeline, take #2 2020-08-14 15:50:25 +02:00
Sébastien Hinderer b1ffaf6008 Define Inria CI's other-configs job as a Jenkins pipeline, take #1 2020-08-14 14:39:33 +02:00
Sébastien Hinderer e05fc92d12 Notify only on regressions for Inria CI's Risc-V job 2020-08-13 19:08:07 +02:00
Sébastien Hinderer 5cdc8072be Define Inria CI's Risc-V job as a Jenkins pipeline, take #1 2020-08-13 14:44:06 +02:00
Sébastien Hinderer 2f16b98a8d Notify only on regressions for Inria CI's bootstrap job 2020-08-13 14:17:53 +02:00
Sébastien Hinderer d0d8acecb0 Use a pipeline to define the bootstrap Jenkins job, take #1 2020-08-13 11:18:10 +02:00
Gabriel Scherer 68218d1906 Changes: reorder 4.11 Changes entries 2020-08-11 22:58:51 +02:00
Gabriel Scherer 07ddbe22eb Changes: #9790 is in 4.12, not 4.11 2020-08-11 22:33:11 +02:00