Commit Graph

20 Commits (540996d21ee3793a1cecce252c81fb76a6b9fd61)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
David Allsopp c35dc17664 Guard heap functions with CAML_INTERNALS 2020-09-04 15:57:57 +01:00
Stephen Dolan 07bf49db5b Statmemprof support for native allocations (incl. Comballoc) 2020-01-25 22:55:56 +01:00
Guillaume Munch-Maccagnoni cebb0ce91e Revert an include of compatibility.h
Before a7b5bb6f06 from #8713, includes of compatibility.h used to be
all guarded by `#ifndef CAML_NAME_SPACE`. The solution at a7b5bb6f06
required to change two of those guard into `#ifndef CAML_INTERNALS`.
The solution finally retained for 4.10 at #9253 (646d30404e in
trunk) does not depend on this change anymore, and one of the two
guards was changed back into `#ifndef CAML_NAME_SPACE`. This patch
changes the second one back as before.

Since a second CAML_NAME_SPACE guard is contained in compatibility.h,
the potential impact is limited to two of the macros that are not
guarded in this way: caml_stat_top_heap_size and caml_stat_heap_size,
and limited to programs that somehow came to rely on this in 4.10.

Since this patch reverts the situation as in 4.09, the current patch
is preferable to include in 4.10, and it is very low risk.

No Changes needed.
2020-01-22 12:00:30 -03:00
Gabriel Scherer 646d30404e Merge pull request #9253 from Octachron/easier_compat
4.10, #9205: move back caml_* to thematic headers

(cherry picked from commit 036495ba5c97ff96962d1e6f746e72a5836a4946)
2020-01-21 22:02:57 +01:00
Jacques-Henri Jourdan 0c8416478c Drop support for tags in memprof.
They are somewhat difficult to handle for native allocations, and it is not clear how useful they are. Moreover, they are easy to add back since [Gc.Memprof.allocation] is a private record.
2020-01-11 13:19:10 +01:00
Stephen Dolan 47b03758f3 Add assertions to ensure young_ptr is correctly updated before GC.
In debug builds, the minor GC now asserts that young_ptr points to
a valid minor heap header before starting GC. Since very few bit
patterns are valid minor heap headers, this is unlikely to be true
by coincidence.

This patch also ensures that minor allocations have color 0. This
was inconsistent between backends before.
2019-10-22 11:47:31 +01:00
Guillaume Munch-Maccagnoni aa13b8cc97 Document new behaviour and upgrade path (check_urgent_gc) 2019-09-28 02:09:55 +02:00
Jose Fernando Lopez Fernandez e6096b8f6c Removed function caml_init_alloc_for_heap from memory.h (#8710)
* Removed the function 'caml_init_alloc_from_heap' from memory.h, as well as it's definition in memory.c, and the calling code in gc_ctrl.c. The function was unconditionally returning zero with no other functionality, as explained in issue #8709.

No change entry needed.
2019-09-23 16:04:43 +02:00
Jacques-Henri Jourdan c0dbbfdd71 Memprof: stop using C global roots, and use our own root system.
Registering and unregistering global C roots was time consuming.
2019-08-27 19:05:03 +02:00
David Allsopp a7b5bb6f06 Propagate Caml_state_field 2019-08-24 12:15:49 +02:00
KC Sivaramakrishnan ad96dec89c Use domain state field names that do not conflict with compatibility.h
The domain state structure (caml_domain_state) uses certaing field names
(young_start, young_limit, etc.) that conflict with the macro
definitions in compatibility.h that use the same names. These macro
definitions are made only when CAML_NAME_SPACE is not defined. To avoid
conflict, when CAML_NAME_SPACE is not defined, we prefix the field names
in caml_domain_state with an underscore.

Update .depend files.
2019-08-23 09:59:53 +05:30
KC Sivaramakrishnan e96220a96f Simplify awk scripts, fix comments and signatures. 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan cededf23b9 Move local_roots, compare unorderd and gc request variables to domain state 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan 45b1e18f59 young_ptr and young_limit are now in domain state 2019-08-23 09:50:05 +05:30
Jacques-Henri Jourdan 79088fb09d Guarantee that no finalisers will be called while allocating memory in OCaml heap from C code.
The finalizers and all the other asynchronous callbacks (including
signal handlers, memprof callbacks and finalizers) are now called in a
common function, [caml_async_callbacks]. It is called in
[caml_check_urgent_gc] and wherever [caml_process_pending_signals] was
called.

This makes it possible to simplify the [caml_gc_dispatch] logic by
removing the loop it contains, since it no longer calls finalizers.
2019-06-05 14:25:26 +02:00
Jacques-Henri Jourdan a2cc89c605 Bugfix: handle the OOM case in [capture_callstack_major]. 2019-05-21 15:13:44 +02:00
Jacques-Henri Jourdan cea1ff7534 Memprof sampling for blocks in the minor heap, allocated by C code.
Allocations ignored by this version
- Marshalling
- In the minor heap by natively-compiled OCaml code

Allocations potentially sampled
- In the major heap
- In the minor heap by C code and OCaml code in bytecode mode
2019-05-20 13:04:28 +02:00
Jacques-Henri Jourdan 052a950dea Statistical memory profiling of blocks allocated in the major heap. 2019-05-09 16:40:45 +02:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00