summaryrefslogtreecommitdiff
path: root/byterun
Commit message (Collapse)AuthorAgeFilesLines
* If <stdint.h> not available (e.g. MSVC), define {u,}int16_t types ourselves.Xavier Leroy2015-11-191-0/+6
|
* GPR#268: Hexadecimal notation for floating-point numbersXavier Leroy2015-11-191-28/+162
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge of branch 'hex-float'. - Add support in byterun/floats.c for conversions between floats and strings in hex notation. We cannot rely on the C standard library here because Microsoft consistently fails at supporting hex notation as standardized in C99. Instead, the conversions are implemented from scratch. - Add support in the lexer so that hex float literals are recognized in OCaml sources. - Add support in formats. The ISO C99 format letters for hex floats are %a and %A, but %a is already taken. I chose %h and %H, which are rejected today as bad formats (hence no backward incompatibility) and don't mean anything in C either (h is a modifier, not a format letter). - Add support in printf. All the trimmings are there in the implementation of %h and %H, including sign modifier and fixed precision. - Benoit Vaugon contributed support in scanf. Resolved conflicts: boot/ocamlc boot/ocamldep boot/ocamllex parsing/lexer.mll
| * Preliminary support for hexadecimal notation for FP numbers.Xavier Leroy2015-07-261-28/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | - Primitives: caml_float_of_string extended to recognize "0x" hexa notation caml_hexstring_of_float new primitive We do not assume hex floats are supported by the C standard library. Instead, conversions hex string <-> float are implemented manually. - Printf: hex FP output supported with formats %h / %H - Scanf: remains to be updated (see TODO in stdlib/scanf.ml) git-svn-id: http://caml.inria.fr/svn/ocaml/branches/hex-float@16257 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | Merge pull request #224 from ocaml/big-marshalXavier Leroy2015-11-193-206/+366
|\ \ | | | | | | | | | PR#6910 and GPR#224: extend marshaling to support data encodings beyond 4 Gb
| * | Minor fixes following the discussion on pull request 224:big-marshalXavier Leroy2015-10-192-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | - intern.c: watch out for left shift overflow - extern.c: refactor caml_output_value_to_block git-svn-id: http://caml.inria.fr/svn/ocaml/branches/big-marshal@16522 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| * | Typo: >> should have been <<.Xavier Leroy2015-09-151-1/+1
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/big-marshal@16425 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
| * | Add alternate marshaling format, used when marshaled data is >= 4 Gb.Xavier Leroy2015-08-033-206/+370
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/big-marshal@16324 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Improve speed of classify_floatXavier Leroy2015-11-151-20/+16
| | | | | | | | | | | | | | | | | | As suggested in the discussion of GPR#272: - Do not go through fpclassify() (speedup: 2 to 3) - Add 64-bit variant of the code (additional speedup: 10%-20%)
* | | PR#6945 and GPR#227: protect Sys and Unix functions against string arguments ↵Xavier Leroy2015-11-131-0/+4
| | | | | | | | | | | | | | | | | | | | | containing the null character '\000' Continuation of commit dc043a7: - Protect Sys.command
* | | Fix PR#4166, PR#6959: force linking when calling external C primitivesJacques Garrigue2015-11-131-0/+6
| | |
* | | PR#6945 and GPR#227: protect Sys and Unix functions against string arguments ↵Xavier Leroy2015-11-113-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | containing the null character '\000' Implementation notes: - Based on c-cube's GPR#227 code, but many Unix functions were missing. - For Unix.bind and Unix.connect to a PF_UNIX address, tolerate file names whose first character is '\000': in Linux, these have a meaning as "abstract socket addresses", and in other operating systems, the resulting empty path name causes a EINVAL error (tested under MacOS X). - Very lightly tested. - win32unix remains to be fixed.
* | | simplify .gitignore; remove .ignore files and tools/setignore; adjust ↵Damien Doligez2015-11-062-16/+0
| | | | | | | | | | | | tools/check-typo
* | | Make `Pervasives.ldexp` unboxed and noallocFrançois Bobot2015-11-051-0/+7
| | |
* | | Make specialized compare unboxedFrançois Bobot2015-11-052-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - float - int32 - int64 - nativeint Not for int because the comparison is done directly on the untagged version. Useful mainly for floats since they can be stored unboxed in records or arrays.
* | | Make `Sys.time` unboxed and noallocFrançois Bobot2015-11-051-5/+10
| | |
* | | Add a note suggesting to switch to the emulation of clasify_float as a ↵alainfrisch2015-11-031-0/+6
| | | | | | | | | | | | faster alternative to calling the libc.
* | | Merge branch 'trunk' of github.com:ocaml/ocaml into unbox_classify_floatalainfrisch2015-11-034-15/+59
|\ \ \
| * | | Switch a few externals to [@@unboxed]Jeremie Dimino2015-11-031-12/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Switched the following functions: - {Nativeint,Int32,Int64}.{of,to}_float - Int{32,64}.float_of_bits - Int{32,64}.bits_of_float
| * | | byterun/ yacc/ : replace some K&R function declarations with proper prototypes.Xavier Leroy2015-11-032-3/+3
| | | |
| * | | transl_exception_constructor now uses ImmutableMark Shinwell2015-10-281-0/+6
| | | |
* | | | No need to use CAMLprim for native form of primitives.alainfrisch2015-11-031-1/+1
| | | |
* | | | Avoid boxing floats when calling Pervasives.classify_float.alainfrisch2015-10-281-3/+8
|/ / /
* | | GPR#164: more efficient (branchless) implementation of Pervasives.compareXavier Leroy2015-10-251-8/+5
| | | | | | | | | | | | | | | | | | | | | specialized at type 'float'. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16539 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | move the new record field of channel to avoid breaking some stubs in JS CoreDamien Doligez2015-10-232-1/+2
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | fix PR#7003 and a few other bugs caused by misuse of Int_valDamien Doligez2015-10-193-5/+5
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16525 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | fix undefined left shift of negative value.Gabriel Scherer2015-10-171-1/+1
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16520 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Build system: fix a few hardcoded ar commands.Gabriel Scherer2015-10-091-1/+1
| | | | | | | | | | | | | | | | | | (Daniel Bünzli) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16485 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | GPR#243: Faster test suiteDamien Doligez2015-10-092-0/+3
| | | | | | | | | | | | | | | | | | | | | (Xavier Leroy) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | whitespace cleanup, cut long lines, add some missing headersDamien Doligez2015-09-1117-46/+67
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | add create_float_array and deprecate make_float_arrayDamien Doligez2015-09-071-1/+1
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16407 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | backtrace: Require caml_val_raw_backtrace_slot to return an immediate valueGabriel Scherer2015-08-222-2/+5
| | | | | | | | | | | | | | | | | | From: Frédéric Bour <frederic.bour@lakaban.net> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16370 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Adjust documentationGabriel Scherer2015-08-224-47/+66
| | | | | | | | | | | | | | | | | | From: Frédéric Bour <frederic.bour@lakaban.net> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Only register caml_backtrace_last_exn as root once.Gabriel Scherer2015-08-224-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This simplify the code, would have prevented GPR#205 and prepare ground for upcoming improved backtrace generation. From: Frédéric Bour <frederic.bour@lakaban.net> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16367 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Document backtrace infrastructure, make types more explicitGabriel Scherer2015-08-224-17/+113
| | | | | | | | | | | | | | | | | | From: Frédéric Bour <frederic.bour@lakaban.net> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16366 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Move backend specific backtrace code to backtrace_prim.cGabriel Scherer2015-08-224-453/+556
| | | | | | | | | | | | | | | | | | | | | | | | And share backtrace.c between asmrun and byterun. From: Frédéric Bour <frederic.bour@lakaban.net> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16365 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Handle custom block with finalizers in deserialization. Fix PR#3612Gabriel Scherer2015-08-161-0/+10
| | | | | | | | | | | | | | | | | | (Pierre Chambart) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16358 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Allow allocating custom blocks with finalizers in the minor heap.Gabriel Scherer2015-08-163-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Pierre Chambart) When allocating this kind of blocks to the minor heap, they are added to 'caml_finalize_table' which is traversed on 'caml_empty_table' to check if any of such block is dead. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16357 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Move bytecode debug info from the OCaml heap to static allocationsGabriel Scherer2015-08-161-59/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | make alldependGabriel Scherer2015-08-151-33/+33
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16352 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | add primitive caml_sys_isatty; fix bootstrapGabriel Scherer2015-08-151-1/+21
| | | | | | | | | | | | | | | | | | (Simon Cruanes) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16346 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | minor: explicit a precondition on rootlist->level to please Clang analyzerGabriel Scherer2015-08-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | globroots.c:98:21: warning: Dereference of undefined pointer value e->forward[i] = update[i]->forward[i]; ^~~~~~~~~~~~~~~~~~~~~ git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16336 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | fix the backtrace.c fixGabriel Scherer2015-08-051-1/+1
| | | | | | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16335 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | fix an issue spotted by the Clang analyzer (potential malloc(0) call)Gabriel Scherer2015-08-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | byterun/backtrace.c:142:12: warning: Call to 'malloc' has an allocation size of 0 bytes events = malloc(*num_events * sizeof(struct ev_info)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16332 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | | Fix call to undeclared function "caml_ml_enable_runtime_warnings" in ↵Xavier Leroy2015-08-045-27/+35
|/ / | | | | | | | | | | | | | | | | | | | | | | startup_aux.c This is a follow-up to commit r16245, PR#6902, GPR#210. - Runtime warning machinery was local to io.c; make it globally usable. - Move definitions and accessor functions to misc.c and gc_ctrl.c by analogy with other configurable runtime parameters. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16325 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | make alldependGabriel Scherer2015-08-021-610/+607
| | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16318 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | GPR#221: use CAMLnoreturn_{start,end} in the same way as CAMLunused_{start,end}Gabriel Scherer2015-08-025-28/+107
| | | | | | | | | | | | This is ugly. C pragmas are ugly. At least we're ugly and consistent now. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16315 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | GPR#165: refactor and document CAMLunused{,_start,_end}Gabriel Scherer2015-08-021-13/+12
| | | | | | | | git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16314 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | GPR#221: keep Noreturn and add CAMLnoreturn_{start,end}Gabriel Scherer2015-08-025-26/+34
| | | | | | | | | | | | (Bernhard Schommer) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16313 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | GPR#165: reintroduce 'CAMLunused' for backward compatibility reasons.Gabriel Scherer2015-08-021-0/+5
| | | | | | | | | | | | (Bernhard Schommer) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16312 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* | PR#6649, GPR#222: accept (int_of_string "+3")Gabriel Scherer2015-08-021-1/+2
| | | | | | | | | | | | (Christopher McAlpine) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16308 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02