1. Revert "Switch to -custom for bytecode tests."
This reverts commit 6b7f81caf5.
2. Revert "Fix Changelog."
This reverts commit d94488d7b5.
3.Revert "Fix testsuite: use binary channels."
This reverts commit 840f7ca506.
4. Revert "Fix testsuite: do not require a globally installed ocamlrun."
This reverts commit 0388ef46d9.
5. Revert "Merge branch 'trunk' of https://github.com/bvaugon/ocaml into bvaugon-trunk"
This reverts commit 1ff6db10bf, reversing
changes made to 89d116c514.
In a format following that of Gc.print_stat. I chose to print only the "quick_stat"
values rather than call gc_ctrl.c::heap_stats because it's lighter, and the extra
information is typically not very useful at program exit.
Also adds documentation for the 0x400 flag (in man and Gc module)
This replaces the previous undocumented 0x400 that only displayed the
total (minwords + majwords - prowords) and with a different format,
since keeping both wouldn't provide more information.
This way, error handling is done in the OS-specific file (unix.c or win32.c).
In turn, this makes it easier to report a good Sys_error exception
in case of Win32 socket I/O error.
I replaced all calls to stat_alloc_no_raise by plain mallocs.
Also, I reimplemented alloc_shr_no_raise by duplicating the code of alloc_shr to avoid any overhead induced by an extra function call.
Prevents the function `caml_alloc_shr` to raise an OOM exception
before intern_cleanup could be called (this complete commit 1e62f1b).
It defines a new caml_alloc_shr_no_raise function.
In the function, `intern_alloc` a call to caml_alloc_for_heap is very likely to
return NULL when reading a big marshaled value. If that happens, before raising
out_of_memory, it should call the `intern_cleanup` function to free the stack
as well as `intern_input` that may have been malloced by `caml_input_val`.
Similarly, `intern_cleanup` should also be called when we are not able to
allocate `intern_obj_table`. To do that, I added a function
`caml_stat_alloc_no_raise` which, like its brother, `caml_stat_alloc` wraps
some debugging information around a call to malloc. I could have used directly
malloc instead of adding a new function to memory.c, as it is done in other
places of the code (it has the drawback of not adding the debug tag).
Note that this fix is not perfect. The function `intern_alloc` could also raise
out_of_memory through its call to `caml_alloc_shr`. It is less likely to happen
since caml_alloc_shr is only called when the input is smaller than Max_wosize
but it could happen. In that case, there will be leak (but a smaller one).
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
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%)
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.
- 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.