Commit Graph

11 Commits (master)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Enguerrand Decorne b7f0494df5 Rewrite the instrumented runtime to store traces in the CTF format.
The instrumentation code in the instrumented runtime was replaced
with new APIs to gather runtime statistics and output them in a new format
(Common Trace Format).
This commit also exposes new functions in the Gc module to pause or resume
instrumentation during a program execution (Gc.eventlog_pause and
Gc.eventlog_resume).
2020-04-30 10:32:01 +02:00
Guillaume Munch-Maccagnoni d0f70f757a Resource-safe C interface for async callbacks
Introduce caml_process_pending_actions and
caml_process_pending_actions_exn: a variant of the former which does
not raise but returns a value that has to be checked against
Is_exception_value.

I keep the current conventions from caml_callback{,_exn}: For a
resource-safe interface, we mostly care about the _exn variants, but
every time there is a public _exn function I provide a function that
raises directly for convenience.

They are introduced and documented in caml/signals.h.

Private functions are converted to their _exn variant on the way as
needed: for internal functions of the runtime, it is desirable to go
towards a complete elimination of functions that raise implicitly.

Get rid of the distant logic of caml_raise_in_async_callback. Instead,
caml_process_pending_events takes care itself of its something_to_do
"resource". This avoids calling the former function in places
unrelated to asynchronous callbacks.
2019-10-17 20:14:19 +02:00
Guillaume Munch-Maccagnoni d0c8219726 [minor] When calling gc_dispatch directly, avoid setting caml_something_to_do
caml_minor_collection is not a new function, it is already used in the
wild and used to be exposed in caml/minor_gc.h in the past. The change
simply amounts to replacing a call to caml_request_minor_gc() with an
assignment requested_minor_gc = 1, bypassing
caml_set_something_to_do().
2019-10-16 14:22:49 +02:00
Guillaume Munch-Maccagnoni 2433b9373f Separate caml_check_urgent_gc back into GC actions and async callbacks
In 8691, caml_check_urgent_gc was merged with the function that runs
asynchronous callbacks. The rationale was that caml_check_urgent_gc
already runs finalisers, and so could have run any asynchronous
callbacks.

We agreed on a different strategy: we know that users could not rely
on asynchronous callbacks being called at this point, so take the
opportunity to make it callback-safe, like was done for allocation
functions.

The new check_urgent_gc no longer calls finalisers (nor any
callbacks), and instead two internal functions are introduced:

* caml_do_urgent_gc_and_callbacks : function to perform actions
  unconditionally.

* caml_check_urgent_gc_and_callbacks : function that checks for
  something to do, and then executes all actions (GC and callbacks).
2019-10-15 19:24:41 +02:00
KC Sivaramakrishnan 6efd278286 Remove a level of indirection for accessing minor tables from Caml_state. 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan 0d19da48d4 Make depend. Fix reference to ref table. 2019-08-23 09:50:05 +05:30
Alain Frisch 430c20bb78
A new runtime primitive for Array.fill (#8716) 2019-07-16 09:21:23 +02:00
Jacques-Henri Jourdan d741f45849 No need to call [caml_initialize] in [caml_make_vect], since we make sure the initial value is not in the minor heap. 2019-05-05 17:02:32 +02:00
Damien Doligez c244e2db6e
Fix caml_make_float_vect (#2183)
When configured with -no-flat-float-array, the primitive caml_make_float_vect
(known as Array.create_float in OCaml) is completely broken:
1. it fails to raise Invalid_argument when the size is negative or too large.
2. it fails to initialize its result, which immediately leads to segfault.
2018-12-28 14:14:32 +01:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00