Commit Graph

794 Commits (8851e6b7d5850ff5d7dab6971f3a1bc26455b1f4)

Author SHA1 Message Date
Gabriel Scherer ceb5e0baa8 Move bytecode debug info from the OCaml heap to static allocations
There is currently a GC bug in the bytecode debug-info handling, due
to the fact that
  void read_main_debug_info(struct debug_info *di)
is passed a internal pointer in the middle of a custom block inside
the OCaml heap. I could only observe the bug when such custom blocks
are allocated on the minor heap -- which does not happen with the
current implementation, but becomes possible after GPR#92 for example
(which let custom blocks with finalizer be allocated in the
minor heap).

This commit fixes this issue by moving debug_info chunks from the
OCaml heap to the C land, stored in a dynamic table. They are
allocated when caml_add_debug_info is called, and removed when
caml_remove_debug_info is called.

(Another approach would be to keep the debug_info inside the OCaml
heap, but make sure that there are no dangling internal pointers. See
GPR#228 for an attack of this by Mark Shinwell.)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16356 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 20:56:12 +00:00
Gabriel Scherer 459061e182 update changelog for PR#207 (coloring messages)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16350 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:55 +00:00
Gabriel Scherer ca7b3c1980 add release dates to Changelog
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16343 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-09 11:41:12 +00:00
Gabriel Scherer 12663d47ef update Changes to record the potentially-breaking change of GPR#155
* PR#6816: reject identifiers following numeric literals without spacing, e.g.
      let foo = 1 in (fun a b -> a,b) 23foo
    (Hugo Heuzard)

(Thanks to Daniel Bünzli for reminding me.)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16317 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 17:18:44 +00:00
Gabriel Scherer 3c4e307bfd update Changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16316 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 16:54:25 +00:00
Gabriel Scherer 0b1575a6b0 GPR#201: Keep general types of Printf.{ifprintf,ikfprintf}
(Maxence Guesdon)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16309 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 15:36:58 +00:00
Gabriel Scherer 370677b639 PR#6649, GPR#222: accept (int_of_string "+3")
(Christopher McAlpine)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16308 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 13:32:44 +00:00
Gabriel Scherer 60314e38c5 fix -dsource error on recursive modules
(Hongbo Zhang)

when printing recursive module the old version would print no space
before 'and':
  A : ... = struct
    ...
  endand B : ... = ...

this tiny PR fixes such problem

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16307 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 13:05:53 +00:00
Gabriel Scherer 5756c0ae69 update Changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16306 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 13:05:51 +00:00
Gabriel Scherer a3041d9550 Added the missing POSIX signals in Sys (Guillaume Bury)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16302 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 13:05:45 +00:00
Damien Doligez 1326b12f74 merge branch 4.02 from rev 16205 to rev 16238
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16296 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-29 22:19:24 +00:00
Xavier Leroy 688d5a5915 Changed OCamlbuild's license to LGPL with static linking exception.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16294 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-28 13:18:34 +00:00
Xavier Leroy bd88ddb4fb Mention commit r16269 (merge of GPR#115).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16272 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-27 09:44:20 +00:00
Alain Frisch 01d4824c21 GPR#107: Prevent more unnecessary float boxing, especially in if and match. Patch by V. Brankov.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16271 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-27 09:40:27 +00:00
Gabriel Scherer 14a844ece1 update Changelog
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16267 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:28:58 +00:00
Gabriel Scherer 5a47e0cb7b GPR#156: Optimize reallocation of caml_frame_descriptors
(Pierre Chambart)

It now reallocates and reinitialises the whole table only when it is
too small. This avoids quadratic behavior when loading a lot of module
with dynlink.

This was problematic on frama-c when inlining increase the code
size. The frame table initialisation took ~0.5 second. This is quite
noticeable on real examples where the whole frama-c analysis is ~1.5s
long.

Also allows to unregister a frametable.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16260 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:01:47 +00:00
Gabriel Scherer e91bb93784 GPR#196: Make [Thread.id] and [Thread.self] [noalloc].
(Clark Gaebel)

These functions are called every tick of the Async scheduler, and
are the only remaining calls to [caml_c_call] every cycle. It would
be nice to remove them, especially since these functions don't
allocate.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16259 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:01:45 +00:00
Gabriel Scherer 235ee2ddef GPR#26: support for "(type a b ..)" as sugar for "(type a) (type b) .."
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16258 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:01:42 +00:00
Gabriel Scherer 6c419e8a17 PR#6924: Tiny optim to avoid some spilling of floats in x87
(Alain Frisch)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16254 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-25 20:44:08 +00:00
Gabriel Scherer d939804269 GPR#208: add "asm" ocamlbuild tag to enable -S
(Patch by ygrek)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16252 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-25 20:44:05 +00:00
Gabriel Scherer 907305ce20 PR#6938: fix regression on "%047.27{l,L,n}{d,i,x,X,o,u}"
(Benoît Vaugon, report by Arduino Cascella)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16250 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-25 20:44:02 +00:00
Xavier Leroy af4e6bff91 PR#6896: serious reimplementation of Big_int.float_of_big_int and
Ratio.float_of_ratio, ensuring that the result is correctly rounded.

The previous implementations were embarassingly imprecise and slow.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16247 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 17:44:12 +00:00
Alain Frisch f29322000e Text.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16246 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 16:11:38 +00:00
Alain Frisch 49a2533472 PR#6902, GPR#210: runtime emits a warning when finalizing an I/O channel which is still open.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16245 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 13:11:26 +00:00
Xavier Leroy 60384ed840 For read-and-clear, use GCC/Clang atomic builtins if available.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16244 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 12:38:55 +00:00
Xavier Leroy 58c07fa89e PR#6722: compatibility with x32 architecture (x86-64 in ILP32 mode)
configure: deselect ocamlopt, which is not supported
signals_machdep.h: use i386 instruction sequence, not amd64.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16243 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 12:31:42 +00:00
Xavier Leroy a1bafbbb67 PR#6316: Scanf.scanf failure on %u formats when reading big integers.
The approach implemented is the second one suggested by Benoît Vaugon in the PR:
- The int_of_string functions accept a "0u" prefix meaning "decimal unsigned".
- The '%u' format of the scanf functions adds this "0u" prefix before conversion.
This is consistent with the current handling of unsigned hexa, octal, and binary numbers.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16241 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 09:36:03 +00:00
Damien Doligez 3e17d04ef0 PR#6931: Incorrect error message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16235 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-22 14:04:39 +00:00
Alain Frisch 748ec06e6e GPR#109: new unboxing strategy (patch by vbrankov).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16215 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 15:47:59 +00:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Jacques Garrigue c2984fe481 add tests related to PR#6899
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16190 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-29 07:33:28 +00:00
Leo White 5c55e4cc08 Attach documentation comments to Parsetree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16189 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-28 13:11:50 +00:00
Alain Frisch 30450e77df Fix GPR#205: Clear caml_backtrace_last_exn before registering as root.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16187 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-23 16:10:03 +00:00
Jacques Garrigue fbcfd218f1 Fix PR#6899
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16184 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-23 08:40:10 +00:00
Jacques Garrigue b650a13145 Fix PR#6897 as suggested by Alain
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16176 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-17 11:09:49 +00:00
Alain Frisch b97538a7ad #5528: add note in Changes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16164 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-08 13:57:50 +00:00
Mark Shinwell 8df90ef051 Port fix for GPR#191 to trunk (making gc.h and some part of memory.h public)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16163 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-08 13:21:42 +00:00
Jacques Garrigue d953f6e079 Fix PR#6886
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16152 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-03 22:53:25 +00:00
Gabriel Scherer c266229488 Changelog: add release dates of released versions
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16147 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-31 08:05:55 +00:00
Gabriel Scherer c9a896c255 Changelog attribution information
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16142 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-25 08:47:21 +00:00
Gabriel Scherer d19a8bd2f1 PR#6636: add a --version option (Peter Zotov)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16141 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-24 14:52:57 +00:00
Gabriel Scherer e9785253b2 PR#6876: improve warning 6 by listing the omitted labels.
(Eyyüb Sari)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-24 07:33:32 +00:00
Jacques Garrigue 1585a95502 Fix PR#6874 by pushing module pattern bindings together with default arguments; also merge functions in Simplif.simplify_lets.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16135 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-21 00:22:46 +00:00
Jacques Garrigue bf2c5c3c17 Fix PR#6870
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16122 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-17 03:07:10 +00:00
Jacques Garrigue 6f5241de44 Fix PR#6872
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16121 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-17 02:36:30 +00:00
Gabriel Scherer 65bb607cd7 PR#6733: ocamlbuild .{byte,native}.so targets and runtime_variant(X) flag
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-10 05:51:25 +00:00
Jacques Garrigue 691aabb723 Fix PR#6849 and PR#6862
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16102 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-09 02:17:36 +00:00
Damien Doligez af4063ebf3 PR#6341: ocamldoc -colorize-code adds spurious <br> tags to <pre> blocks
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16082 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-05 19:05:18 +00:00
Alain Frisch b94c4b840f GPR#174: ensure that Set.remove and Set.filter return the original set (physically) when no change is required. Also avoid allocations in this case. Similar to what had been done for Set.add in #6645.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16080 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-05 16:08:00 +00:00
Damien Doligez ea845ce074 GPR#159: Better locations for structure/signature items
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16075 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-04 18:44:11 +00:00