Commit Graph

1643 Commits (e8625747fa4d96b0e42bc5568e4efb3b288ec320)

Author SHA1 Message Date
alainfrisch 7ad212045f Add module to deal with 'front-end' built-in attributes. 2015-12-02 14:46:14 +01:00
Xavier Leroy 906558a155 PR#7038: out of memory condition in caml_io_mutex_lock
Check the return code of st_mutex_create so that, in particular, out-of-memory conditions cause an exception.
2015-11-27 15:33:15 +01:00
Xavier Leroy bf87415c1c PR#7024: in documentation of Str regular expressions, clarify what "end of line" means for "^" and "$" regexps. 2015-11-26 15:08:34 +01:00
Xavier Leroy 9b1a371291 PR#6945 and GPR#227: protect Sys and Unix functions against string arguments containing the null character '\000'
Continuation of commit dc043a7.
Fix wrong declaration of cstringvect.
2015-11-16 14:10:25 +01:00
Xavier Leroy ef8bc511ce PR#4023 and GPR#68: add Unix.sleepf and improve Unix.sleep
Follow-up to commit 50648ed: update otherlibs/threads.
2015-11-16 10:48:14 +01:00
Xavier Leroy 50648ed2b7 PR#4023 and GPR#68: add Unix.sleepf and improve Unix.sleep
Unix.sleepf provides sleep with sub-second resolution.
Unix.sleep is implemented on top of Unix.sleepf.
If a handled signal causes the sleep to return early with an EINTR
error, catch it and restart the sleep for the remaining time.
2015-11-15 15:34:45 +01:00
Xavier Leroy 9893e265d8 PR#6945 and GPR#227: protect Sys and Unix functions against string arguments containing the null character '\000'
Continuation of commit dc043a7.  The following otherlibs/unix/ functions were not protected:
unix_inet_of_string
unix_getgrnam
unix_getpwnam
unix_initgroups
unix_readlink
unix_utimes
2015-11-15 15:13:30 +01:00
Xavier Leroy 29a50b4768 PR#6945 and GPR#227: protect Sys and Unix functions against string arguments containing the null character '\000'
Continuation of commits dc043a7 and 9dfa69e:
- Add checks for the command-line arguments and for the environment
  variables passed via Unix.exec* and variants.
2015-11-13 14:49:50 +01:00
Xavier Leroy 9dfa69e546 PR#6945 and GPR#227: protect Sys and Unix functions against string arguments containing the null character '\000'
Continuation of commit dc043a7:
- Update the win32unix/ files with the new checks.
- Completely untested, not even compiled.
2015-11-11 17:23:40 +01:00
Xavier Leroy dc043a7b62 PR#6945 and GPR#227: protect Sys and Unix functions against string arguments 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.
2015-11-11 17:07:44 +01:00
Xavier Leroy ed0a785f02 PR#7039: Unix.getsockname returns garbage for unnamed PF_UNIX sockets.
Fix implemented: return ADDR_UNIX "" in this case (the file name is the empty string).
2015-11-11 11:39:10 +01:00
Damien Doligez 7cb9a80744 simplify .gitignore; remove .ignore files and tools/setignore; adjust tools/check-typo 2015-11-06 16:25:05 +01:00
François Bobot 203c444fd4 Make `Pervasives.ldexp` unboxed and noalloc 2015-11-05 13:07:03 +01:00
alainfrisch 364f1cb79f Merge branch 'trunk' of github.com:ocaml/ocaml into unbox_classify_float 2015-11-03 21:03:07 +01:00
Xavier Leroy 335c53bfd8 otherlibs/*unix: proper declaration of cstringvect()
Share the declaration in "unixsupport.h", and give it a full prototype.
2015-11-03 11:05:10 +01:00
Xavier Leroy 3f3d8342ac otherlibs/unix: don't use 'h_errno' as a local variable
Under Glibc, 'h_errno' is a macro that expands to a system call, like 'errno'.  Here, we just want a local variable.
2015-11-03 11:03:38 +01:00
alainfrisch 0287ee2ecf Also adapt threads/pervasives.ml. 2015-10-28 16:46:12 +01:00
Xavier Leroy 307f55ade9 PR#7013: spurious wake-up in the Event module.
Tentative fix, to be tested.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16490 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-11 08:55:26 +00:00
Gabriel Scherer bbe24083c5 Delete historical french comments in num library
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16480 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:47 +00:00
Gabriel Scherer 05e7efbdfa Translation of french comments in num library
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:46 +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
Jérémie Dimino 695a592d48 Support [@@noalloc] on external declarations
This is to replace the "noalloc" annotation.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16454 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:20 +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
Xavier Leroy 6e9cd068c7 Support for PowerPC 64 bits big- and little-endian. Revised PowerPC 32 bits support.
Merge of branch 'ppc64'.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16374 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 09:28:33 +00:00
Gabriel Scherer 91d1e34e2d Document backtrace infrastructure, make types more explicit
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
2015-08-22 06:04:20 +00:00
Xavier Leroy 84ebf792e6 Update wrt trunk, revision 16361.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16362 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-20 16:53:53 +00:00
Gabriel Scherer 5b68fbb887 so the dynlink -jN race wasn't quite fixed
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16354 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 20:56:07 +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 3211f63a31 dynlink/Makefile: make dynlink.cmi depend on dynlinkaux.cmi to avoid -jN races
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16345 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-15 15:57:45 +00:00
Xavier Leroy 28eb4583bd Update wrt trunk r16339.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16340 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-06 13:11:57 +00:00
Xavier Leroy 0178ea4e8e unix_gethostbyname: using a variable outside of its scope.
In the case HAS_GETHOSTBYNAME_R == 6, hp may point into h or into buffer,
so don't end the scope of h and buffer before hp is used.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16327 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 11:41:55 +00:00
Gabriel Scherer 57ddbfe12c more CAMLnoreturn_end goodness
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16326 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-04 10:10:14 +00:00
Xavier Leroy cf87a2c664 Update wrt trunk r16319.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16320 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-03 09:18:04 +00:00
Gabriel Scherer 1957021b27 make alldepend
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16318 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 18:34:09 +00:00
Gabriel Scherer edb714dc15 GPR#221: keep Noreturn and add CAMLnoreturn_{start,end}
(Bernhard Schommer)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16313 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-02 16:54:20 +00:00
Xavier Leroy 047749ec9a Of--by-one-bit error in two_power_m1_big_int, causing out-of-bound write if n is a multiple of length_of_digit.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16293 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-28 11:52:21 +00:00
Xavier Leroy c157926a36 float_of_big_int: for negative arguments, the top 55 bits must round towards -inf, otherwise wrong rounding occurs. Hence, use shift_right_big_int and not shift_right_towards_zero_big_int.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16284 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-28 07:49:50 +00:00
Gabriel Scherer 1c29e17fd3 GPR#165: Missing Noreturn moved before the functions and added a missing undef in socketaddr.c
(Bernhard Schommer)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16265 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:28:55 +00:00
Gabriel Scherer a1063f29bf GPR#165: Undef the erno values and redefine them using the winsocket values.
(Bernhard Schommer)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16263 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:28:52 +00:00
Gabriel Scherer 34ab11fbcc GPR#165: Changed the definition of the Noreturn macro to also work with Visual Studio Version >= 2008 using the __declspec(noreturn).
(Bernhard Schommer)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16262 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:28:50 +00:00
Gabriel Scherer 75a7b333ed GPR#165: Added define guards around the macros in unixsupport and for the isnan and isfinite macro.
(Bernhard Schommer)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16261 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 19:28:48 +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
Xavier Leroy 8fc4849b83 big_int.ml: clarify comments.
test_ratios.ml: on x86-32 with x87 extended precision, the computation of the expected result is sometimes wrong because of double rounding in FP division.  Reduce the number of test rounds so that we don't run into this problem.  Note that the float_of_ratio function being tested produces the correct results on x86-x87, because it is immune to double rounding (exact -> extended precision -> double precision).


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16249 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-25 15:25:01 +00:00
Xavier Leroy f9176a1e26 Follow-up to r16247: garbled comment.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16248 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-24 18:01:03 +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 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
Damien Doligez 5afcc281dd remove redundant -O option from C compiler arguments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16234 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-22 13:27:17 +00:00
Xavier Leroy 8815d7e1a2 PowerPC port of ocamlopt:
- Removed MacOS X support, long dead.
- Added support for PowerPC 64 bits, big-endian, ELF v1 ABI
  (tested, mostly works, some issues remain with marshaling of code pointers)
- Added support for PowerPC 64 bits, little-endian, ELF v2 ABI
  (completely untested)


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ppc64@16226 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-20 15:41:44 +00:00
Damien Doligez 392a41b441 fix small problem introduced by merging 4.02
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16219 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-20 11:09:25 +00:00