Commit Graph

1447 Commits (af584b9f1b720a43d4e8cbae565df0fb198a3c09)

Author SHA1 Message Date
Gabriel Scherer b2e81d7800 Merge pull request #267 from yallop/faster-ifprintf
A more efficient implementation of ifprintf
2015-10-31 16:54:40 +01:00
alainfrisch a127e661b2 Code cleanup: replace let-binding of type unit with sequence. 2015-10-27 11:28:36 +01:00
Jeremy Yallop 19301282d5 Use make_iprintf to build Format.ikfprintf and Format.ifprintf. 2015-10-27 00:02:45 +00:00
Jeremy Yallop e999c68622 Use make_iprintf to build Printf.ikfprintf and Printf.ifprintf. 2015-10-27 00:02:45 +00:00
Jeremy Yallop 1644284d0f Add make_iprintf (make_printf optimised for ifprintf) to CamlinternalFormat. 2015-10-27 00:02:45 +00:00
Mark Shinwell 4b4d8a150a Fix compilation error for GPR#238 merge 2015-10-26 10:41:53 +00:00
Mark Shinwell f6538a8abe Merge pull request #238 from chambart/less_unsafe_CamlinternalOO
GPR#238: Make CamlinternalOO a bit less unsafe
2015-10-26 09:47:40 +00:00
Gabriel Scherer 8afbaa5747 New representation for queues, avoiding Obj.magic
(Jérémie Dimino)

- use inline-records to avoid using Obj.magic while keeping
  indirections to the minumum
- change the representation from a cyclic list to a simply-linked
  list. The drawback is one more word per queue, but it makes the
  implementation clearer

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16545 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-25 13:39:07 +00:00
Alain Frisch d813aea23b Remove dead code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 17:04:56 +00:00
Alain Frisch a21eaeaa40 GPR#254: @ocaml.arg_on_literal_pattern attribute on constructors
to warn when the argument is matches against a constant pattern.
This attributes is applied on predefined exception constructors
which take an purely informational (with no stability guarantee)
message.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 12:30:10 +00:00
Gabriel Scherer 5882fdea22 General translation of french comments
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:38 +00:00
Gabriel Scherer b82ef62532 Remove out of date comment of Stream
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16472 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:34 +00:00
Gabriel Scherer 1640764c12 Rename type data' to cell in Stream
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16471 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:33 +00:00
Gabriel Scherer d4ff2bccc1 Remove last Obj.magic in Stream
(Pierre Chambart)

Turn Stream.data into a GADT to ensure that streams built with the
Sbuffio constructor are char streams.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:32 +00:00
Gabriel Scherer 2ac862f27d Make Stream a less unsafe
(Pierre Chambart)

Stream used to modify blocks allocated as immutable. This Get rid of
most Obj module invocations in this module.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16469 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:30 +00:00
Damien Doligez 3397e7ff16 GPR#243: Faster test suite
(Xavier Leroy)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 15:45:37 +00:00
Jérémie Dimino 1b219582a0 Replace uses of "float" by [@@unboxed] [@@noalloc]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16456 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:24 +00:00
Jérémie Dimino 62b89a3a5c Replace uses of "noalloc" by [@@noalloc]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16455 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:22 +00:00
Alain Frisch 12f6a53937 GPR#250: Check for negative start element in Array.sub.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16450 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-05 09:02:05 +00:00
Pierre Weis b16b6dea44 Missing newlines after autodoc comments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16445 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-24 19:03:47 +00:00
Pierre Weis b710ec0a85 Documentation deeply revisited. New phrasing: line splitting versus line
breaking, consistent usage of splitting and split; simpler explanation for
break hints and new documentation for pretty-printing boxes.

Tabulation boxes get deprecated: this mechanism does not interact nicely with
the rest of the pretty-printing engine and should be completely revisited...


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16444 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-24 19:02:09 +00:00
Pierre Weis 36ab801e6f A second attempt to memoize Scanning.from_in_channel using weak pointers.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16443 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-24 18:31:11 +00:00
Pierre Weis 8024d28dc1 Module Weak is used in module Scanf. It is now linked just after module Hashtbl.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16431 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-21 17:18:09 +00:00
Pierre Weis 5485362404 Scanning.from_channel now uses a weak hash table to record in_channel -> scanbuf associations. This should prevent memory leaks in program that intensively call Scanf.fscanf.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16430 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-21 17:17:04 +00:00
Pierre Weis e02d472aa4 Renaming: flush_buf_formatter into flush_buffer_formatter.
flush_str_formatter rewritten using flush_buffer_formatter.

Consistent naming of pretty-printer formatter as ppf not strange x or o
parameters.

Function ksprintf purposedly defines a new continuation embedding the old
one.

Function asprintf rewritten in a more natural way; spurious pp_flush_queue
deleted in the conitnuation, since it is already done via following
flush_buffer_formatter call.

Indent.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16429 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-21 17:08:11 +00:00
Pierre Chambart 162a29f816 Change static to dynamic checks in camlinternalOO 2015-09-21 16:19:45 +02:00
Pierre Chambart 0b067c9531 Clean cruft from camlinternalOO 2015-09-21 16:16:00 +02:00
Pierre Chambart 113da6359a Get rid of some more casts in CamlinternalOO
Turn CamlinternalOO.tables into a GADT with cases distinguished by a
polymorphic variant. This allows to consider the Cons case almost like a
record. There is still one assumption that cannot be checked by typing:
when a key is found in the table, the data field is assumed to be a
Cons. This is dynamically checked. The cost is assumed to be
negligible (The branch should be well predicted by the processor).
2015-09-15 00:22:10 +02:00
Pierre Chambart 9dfa889598 Make CamlinternalOO a bit less unsafe
CamlinternalOO used to modify fields of blocks allocated as immutable,
which is unsafe and is going to become even more unsafe. An inline
record is used to allow marking a sum type as mutable.
2015-09-14 18:57:39 +02:00
Pierre Weis 1cd50636fa Bug in function check_char corrected: instead of only accepting \r\n as a new
line, it accepted any amount of \r followed by \n.
Float scanning code revisited, commenting the code and avoiding side effect
in function application.
Type file_name now used to define in_channel_name, hence its definition goes
before in_channel_name.
open/close_in --> Pervasives.open/close_in when necessary.
Indentation revisited.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16421 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-13 18:02:03 +00:00
Pierre Weis 24b8bf59f9 Escaping " in character constants
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16420 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-13 13:17:23 +00:00
Pierre Weis b3b3cd32f6 Code aesthetics: do not confuse labels and regular idents.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16419 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-13 13:15:03 +00:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Damien Doligez b67a732866 add create_float_array and deprecate make_float_array
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16406 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-07 13:49:28 +00:00
Pierre Weis 31a85a87b4 Typos in comments.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16399 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-28 00:12:11 +00:00
Pierre Weis 4a29430773 Correcting various typos in documentation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16398 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-28 00:07:57 +00:00
Mark Shinwell c4e3173807 Fix GPR#233: Make CamlinternalMod.init_mod robust to optimization
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16364 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-21 14:37:11 +00:00
Gabriel Scherer 9a533a50cd make alldepend
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16352 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:59 +00:00
Gabriel Scherer ed057488f2 Order type variables in format parameters
(Maxence Guesdon)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16310 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 15:37:00 +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 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
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
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 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 4b83d53fbc update .depend and bootstrap compilers after 4.02 merge
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16218 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 18:34:07 +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
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
Gabriel Scherer 30d6d06189 PR#6452 (part two): make custom_format string-only
(Jérémie Dimino, Benoît Vaugon)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16106 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-10 06:01:26 +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
Gabriel Scherer 2a153ee5c0 List.cons, finally
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16050 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-26 21:05:28 +00:00