-
Notifications
You must be signed in to change notification settings - Fork 1.2k
GC callbacks #6675
Description
Original bug ID: 6675
Reporter: roshanjames
Status: closed (set by @damiendoligez on 2015-02-10T15:27:10Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: runtime system and C interface
Monitored by: @gasche @diml @ygrek
Bug description
When writing performance sensitive programs, one spends a lot of time worrying about the time spent in the GC. However there are very few tools available to directly measure the time spent in the GC.
Can we have the OCaml runtime fire a C callback when:
- about to start a minor GC
- about to start a major slice in a minor GC
- end of major slice in a minor GC
- end of a GC
It would be nice to have an interface where the user can supply C functions pointers for these situations. I imagine there will be constraints on the C callbacks -- for example, the callbacks must not modify or allocate OCaml memory.