Commit Graph

1196 Commits (b6bdf20ff797c07ae099b71d6442b3d9aa442243)

Author SHA1 Message Date
Damien Doligez 9166e7003e update .depend and bootstrap compilers before release 2016-02-29 14:07:07 +01:00
Damien Doligez 69a906872f tweak tools/check-typo and break more overlong lines 2016-02-19 17:13:53 +01:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
Christophe Troestler 7f6a8ae2f0 Protect install paths against spaces (on Windows) 2016-02-10 14:46:39 +01:00
Damien Doligez 8548fc02fe instrtrace.c: gcc 4.9.3 doesn't like a char as argument to 2016-02-01 15:03:19 +01:00
Damien Doligez 67d88cb9f9 fix commit a80d536
We cannot use ARCH_INTNAT_PRINTF_FORMAT because it isn't guaranteed to
match values of type size_t.

Since this is debugging code, we go for the simple solution and cast
to long.
2016-01-30 11:24:44 +01:00
alainfrisch 3878b84d8b Fix for Windows following merge of GPR#22. 2016-01-27 22:47:31 +01:00
François Bobot e77b7aba50 Use CAML_EPHE_*_OFFSET for better readability
in major_gc
2016-01-25 08:33:57 +01:00
François Bobot d8823e11d4 Do cleaning less often. optimize No_naked_pointer
During clean phase for consistency we need to check if the key
   checked or got is alive or not. Three possibilities:
     - Doesn't unset the key, but still return the right value as if it
       is unset.
     - Unset the key and the data
     - Clean the ephemeron

   Testing aliveness is a little costly, so it is better to amortize
   this cost. Previously the last possibility was implemented but a
   better trade-off seems the second one, since the clean phase is still
   going to clean the ephemeron eventually.
2016-01-25 08:33:57 +01:00
François Bobot 40fd65c485 Check ephemerons after marking globals 2016-01-25 08:33:57 +01:00
François Bobot 4e8a7ff173 Move caml_ephe_clean to the weak.h
So that major_gc.c can inline this function for clean phase.
2016-01-25 08:33:57 +01:00
François Bobot 07b88bb5ac Add a test specifically for weak table
And fix a bug in the handling of ephemeron during minor collection
    found thanks to this test. Oldifying of ephemerons' data was not iterated
    enough because `oldify_todo_list` doesn't become non-null each time
    `caml_oldify_one` is run.
2016-01-25 08:33:57 +01:00
François Bobot cbb96ecdc8 [GC] shortcut in mark_ephe_aux as caml_ephe_clean 2016-01-25 08:33:56 +01:00
François Bobot 300c8e9656 [GC] Fix some comments and debug message 2016-01-25 08:33:56 +01:00
François Bobot 9f7b0872a6 [GC] More comments for ephemerons
and rename some variables
2016-01-25 08:33:55 +01:00
François Bobot e33599880d [GC] make ephemerons more efficient
During one mark phase instead of iterating on every ephemerons every time,
     we don't iterate on the one which data is alive (not white) or at none
     (weak pointer).

     That give us a complexity in O(n*(p+1))
     with m the number of ephemerons,
          p is the maximum of the distance to an ephemeron from its nearest root
          p = max_{e \in ephemerons} min_{r \in roots} distance(r,e)

     One worst case is when ephemerons e_1, ..., e_n are linked
     e_1.data = e_2, ... e_{n-1}.data = e_n but they have been created
     in the reverse order and are iterated from e_n to e_1, O(n*n). In
     order to mitigate this the ephemerons are automatically sorted
     during mark in the order they are triggered. So during the next
     marking phase the ephemerons will be iterated from e_1 to e_n
     giving a complexity of O(n).
2016-01-25 08:33:54 +01:00
François Bobot ff8c0c83c2 [GC] shortcut clean phase when possible 2016-01-25 08:33:54 +01:00
François Bobot e402d38dfe [GC] add full-featured ephemerons in an inefficient way
- use the generic abstract tag like weak pointers
     - a weak pointer is implemented using an ephemeron (one additionnal word)
     - add for every full GC a complexity of O((n+m)*(m+1))
       with m the number of pure ephemerons,
            n the number of ephemerons used as weak pointers
     - multiple keys, modifiable keys
2016-01-23 11:28:01 +01:00
François Bobot d5fffddc63 [GC] move the cleaning of the weak arrays in a new phase
A value disappears from a weak array only when it really becomes unreachable.
     Previously it was not the case if:
     - the value is referenced by two weak arrays and during the incremental cleaning
       one weak arrays have been cleaned and the other is accessed,
     - the value has a finalizer and the finalizer make it alive again.
2016-01-23 11:28:01 +01:00
doligez d94f1da32f [GC] Factorize the management of resizable arrays
For major to minor pointers
2016-01-23 11:28:01 +01:00
François Bobot 3b66770966 [GC] Simplify mark_slice function 2016-01-23 11:28:01 +01:00
François Bobot b7fc239e9a Fix problem reported in GPR#435: assertion failure
The assertion is wrong since 5b8296c.
2016-01-23 11:07:05 +01:00
alainfrisch 129df0ae09 Fix Changes file. 2016-01-18 11:11:39 +01:00
David Allsopp 009e14a20c No need for vsnprintf workaround in VS2015
The Universal CRT includes a compliant implementation of vsnprintf.
2016-01-16 09:24:01 +00:00
David Allsopp 5da5d4ac7d Allow optional bootstrapping of FlexDLL on Windows
Allows the four native Windows ports to compile FlexDLL and flexlink
"in-tree" by placing the sources in directory `flexdll` and issuing
`make -f Makefile.nt flexdll`

FlexDLL must still be installed somewhere in PATH before OCaml itself
can be compiled. The `flexdll` target leaves the OCaml build tree in a
sufficiently clean state to allow `world` to be run after installation
of FlexDLL.
2016-01-15 17:01:30 +00:00
David Allsopp 12a9af9dd8 Use Microsoft UCRT snprintf rather than shim
Microsoft improved the support for C99 in Visual Studio 2015 and added a
compliant implementation of snprintf. Tightens the criteria for
`caml_snprintf` being used instead to ignore the Universal CRT.
2016-01-08 12:32:40 +00:00
David Allsopp 4bdb1461dd Use SUPPORT_DYNAMIC_LINKING in s.h on Windows
Ports some code from byterun/unix.c to byterun/win32.c to allow ocamlrun
to be built without FlexDLL on native Windows.
2016-01-04 11:22:57 +01:00
Gabriel Scherer a80d536bdb fix format-of-pointer warnings on 32bits architectures
(report by Kakadu)

The format `"%ld"` cannot be portably used for values of type
`code_t`; one can use `"%" ARCH_INTNAT_PRINTF_FORMAT "d"` instead, as
intnat is configured to be the integer type of pointer size.
2016-01-01 12:01:00 +01:00
Nicolas Ojeda Bar 00f04279a0 Remove extra `inline` macro definition 2015-12-28 22:01:40 +01:00
alainfrisch 86a610a48d Fix build for MSVC (at least old versions don't know fmin). 2015-12-23 10:50:41 +01:00
Damien Doligez ebe0f9e347 simplify incremental root scanning 2015-12-21 14:27:47 +01:00
Damien Doligez 40d78a80d6 fix wrong variable name caml_stat_heap_size 2015-12-21 14:27:47 +01:00
Damien Doligez 5b8296c933 Revert the change to the GC calling protocol: the allocation pointer
does not need to point to a valid header when the GC is called. On the
other hand, the major GC can only start a cycle when the minor heap
(allocation arena) is empty.
2015-12-21 14:27:46 +01:00
Damien Doligez b7562a7988 add comments 2015-12-21 14:27:46 +01:00
Damien Doligez 0e486d5795 transform `Add_to_ref_table` macro into inline function 2015-12-21 14:27:46 +01:00
Damien Doligez ff8e891242 deduplicate definition of `inline` 2015-12-21 14:27:46 +01:00
Damien Doligez 5c6bd461d5 remove duplicate macro definitions 2015-12-21 14:27:46 +01:00
Damien Doligez c9003ac48f fix huge pages vs renaming of caml_stat_heap_size 2015-12-21 14:27:46 +01:00
Damien Doligez 0225ca01e3 GC latency improvements 2015-12-21 14:27:46 +01:00
Gabriel Scherer a4f0045071 minor: remove useless assignment (clang warning) 2015-12-12 12:07:13 +01:00
Xavier Leroy 86d4023c98 PR#6321: guarantee that "hypot infinity nan = infinity" 2015-12-11 18:45:53 +01:00
Xavier Leroy 77cf36cf82 Merge pull request #331 from ocaml/win32-sockets
Windows sockets in asynchronous mode
2015-12-09 11:51:36 +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
alainfrisch 1ff6db10bf Merge branch 'trunk' of https://github.com/bvaugon/ocaml into bvaugon-trunk 2015-12-04 16:31:59 +01:00
Louis Gesbert 24e42d4d22 Add v=0x400 to OCAMLRUNPARAM to print more Gc stats on exit
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.
2015-12-04 21:09:27 +09:00
Xavier Leroy b6442d5957 Branch win32-sockets: missing includes in byterun/unix.c + add test.
The "socketsbuf.ml" test checks that buffered I/O channels over sockets work properly.  (Regression test for PR#5578.)
2015-12-04 12:01:10 +01:00
Xavier Leroy aacb6d5861 Branch win32-sockets: move do_read and do_write to OS-specific file.
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.
2015-12-04 11:40:11 +01:00
Benoit Vaugon 5e3964da86 Fix "weak hash of serialised closures" from mantis #0005942. 2015-12-04 00:51:44 +01:00
Xavier Leroy bdc8db8649 Typo in do_read (byterun/io.c) 2015-12-01 15:50:55 +01:00