Commit Graph

109 Commits (ee8f71101b80496b2ec2c996d29ac33bbaf7cf00)

Author SHA1 Message Date
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
Damien Doligez ff8e891242 deduplicate definition of `inline` 2015-12-21 14:27:46 +01:00
Damien Doligez 0225ca01e3 GC latency improvements 2015-12-21 14:27:46 +01:00
alainfrisch e888e099e2 Revert commits related to #330.
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.
2015-12-08 14:44:29 +01:00
Benoit Vaugon 5e3964da86 Fix "weak hash of serialised closures" from mantis #0005942. 2015-12-04 00:51:44 +01:00
alainfrisch 092c5e4506 Fixes for MSVC. 2015-11-23 13:30:34 +01:00
Alain Frisch 4788ab33d6 Merge pull request #283 from mlasson/trunk
Fix memory leaks in intern.c when OOM is raised
2015-11-23 13:25:34 +01:00
alainfrisch a9ef6428fc MSVC (at least some old version) does not support inline. Use _inline instead. This #define should perhaps go somewhere else, e.g. caml/misc.h (defined as caml_inline?). 2015-11-23 09:58:44 +01:00
Marc Lasson 448d365d32 Update changelog & remove useless vertical spaces 2015-11-20 17:51:43 +01:00
Marc Lasson 1a2c6310fc Adds a function intern_init to set global state 2015-11-20 17:51:00 +01:00
Marc Lasson 061525dae0 Typo in comment 2015-11-20 17:45:07 +01:00
Marc Lasson 8414d46214 Simplify intern state. 2015-11-20 17:45:07 +01:00
Marc Lasson 15b51b1c7b Assert intern is in a clean state
Assert that intern is in a clean state at the beginning of demarshaling
primitives.
2015-11-20 17:38:35 +01:00
Marc Lasson d6d3744d6f Idempotent intern_cleanup 2015-11-20 17:37:45 +01:00
Marc Lasson 5766c2de36 Delete stat_alloc_no_raise and duplicate alloc_shr
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.
2015-11-20 17:37:45 +01:00
Marc Lasson d4d7bcd48e Fix indentation. 2015-11-20 17:37:45 +01:00
Marc Lasson ddd51af088 Fix memory leaks in intern.c in alloc_shr case
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.
2015-11-20 17:37:45 +01:00
Marc Lasson bd471eb198 Fix a memory leak in concat_array
There is a memory leak when the second or the third call to `caml_stack_alloc`
in `caml_array_concat` raises Out_of_memory. This will fix it.
2015-11-20 17:37:45 +01:00
Marc Lasson de7424404b Fix memory leaks in intern.c when OOM is raised
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).
2015-11-20 17:37:45 +01:00
Xavier Leroy 4fd254e325 Merge pull request #224 from ocaml/big-marshal
PR#6910 and GPR#224: extend marshaling to support data encodings beyond 4 Gb
2015-11-19 09:56:43 +01:00
Damien Doligez 659615c7b1 fix PR#7003 and a few other bugs caused by misuse of Int_val
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16525 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-19 15:47:33 +00:00
Xavier Leroy 782d12c327 Minor fixes following the discussion on pull request 224:
- 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
2015-10-19 11:21:49 +00:00
Gabriel Scherer d020ae12af Handle custom block with finalizers in deserialization. Fix PR#3612
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16358 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-16 21:23:49 +00:00
Xavier Leroy e2d0a13165 Add alternate marshaling format, used when marshaled data is >= 4 Gb.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/big-marshal@16324 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-03 12:27:15 +00:00
Gabriel Scherer 6e224a76a1 GPR#221: use CAMLnoreturn_{start,end} in the same way as CAMLunused_{start,end}
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
2015-08-02 16:54:24 +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
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 7ca29ef3f7 PR#5887: move the byterun/*.h headers to byterun/caml/*.h to avoid header name clashes
(Jérôme Vouillon and Adrien Nader and Peter Zotov)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-27 14:41:49 +00:00
Damien Doligez 1cb0b23a08 Start tidying up the runtime:
- document most of the "size" and "length" parameters and global variables,
  specifying bytes or words. Change some of them from bytes to words.
- start getting rid of "char *" and use sensible types instead.
- other small changes


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15647 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-12 15:18:04 +00:00
Xavier Leroy b868c05ec9 PR#6517: use ISO C99 types {,u}int{32,64}_t in preference to our homegrown
types {,u}int{32,64}.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15131 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-27 09:58:33 +00:00
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Xavier Leroy 774e30e138 PR#6075: avoid using unsafe C library functions (strcpy, strcat, sprintf).
An ISO C99-compliant C compiler and standard library is now assumed.
(Plus special exceptions for MSVC.)  In particular, emulation code for
64-bit integer arithmetic was removed, the C compiler must support a
64-bit integer type.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14607 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 17:09:13 +00:00
Alain Frisch 7c98525d0f Add proper casts.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14304 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-19 10:36:06 +00:00
Alain Frisch 0f6f367ad4 Change the representation of exception slots: instead of being represented as 'string ref', they are now blocks
of size 2, with tag = Object_tag, the first field being the pointer to the string, and second one being a unique id, generated
from the same sequence as for object values.  Special case for predefined exceptions, represented with a negative id.

The unique id generator is moved from camlinternalOO to the C runtime system.

Also fix some bugs.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14239 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-23 14:28:31 +00:00
Xavier Leroy 3dd22133ef PR#5813: GC not called when unmarshaling repeatedly in a tight loop (ocamlopt)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-07 14:06:30 +00:00
Damien Doligez c63f9e0957 fix a few problems with whitespace and over-long lines
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13393 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-09 22:38:52 +00:00
Benedikt Meurer b04d8284f0 Fix several C compiler warnings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13171 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-29 10:41:08 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 526d44647b PR#5757: GC compaction bug (crash)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12912 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-09-10 10:25:18 +00:00
Damien Doligez 997a678d5e clean up TABs and whitespace
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12799 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-30 18:04:46 +00:00
Xavier Leroy 4b9cbab50a PR#5610: new unmarshaler didn't freshen object IDs.
Assorted cleanups and additional comments in byterun/intern.c.
More tests in lib/marshal.
Updated Changes file.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12442 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-08 13:49:35 +00:00
Wojciech Meyer c1cb8aa6fc PR#5318: Unroll recursion in un-marshaller to allow un-marshaling values of arbitral depth. Per advice of Xavier Leroy used defunctionalized continuation trick
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12390 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-04-22 23:37:41 +00:00
Wojciech Meyer e5201eb76c PR#5318: Reverting last un-marshaler changes, to rework the control flow of mainloop and provide better solution for eliminating recursion
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12248 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-19 22:48:27 +00:00
Wojciech Meyer f66308e569 PR#5318: Non-recursive version of extern_rec and intern_rec, to allow marshaling and un-marshaling of deeper data structures
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12247 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-18 02:03:30 +00:00
Xavier Leroy 4e5eb94ed9 PR#5215: Marshalling of closures now supported if the closures come from dynamically-loaded code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12229 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-13 14:50:41 +00:00
Damien Doligez 6c24f4f90b merge version 3.12 from 3.12.1 to r12205
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12210 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-03-08 19:52:03 +00:00
Jacques Garrigue 16d937aa40 fix PR#5436
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11930 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-22 07:30:18 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Damien Doligez 04b1656222 clean up spaces and tabs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-22 12:48:24 +00:00
Damien Doligez 9ea5edac9a merge changes 3.10.0 -> 3.10.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8768 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-01-11 16:13:18 +00:00