diff options
author | Jacques-Henri Jourdan <jacques-henri.jourdan@normalesup.org> | 2019-05-23 16:00:08 +0200 |
---|---|---|
committer | Jacques-Henri Jourdan <jacques-henri.jourdan@normalesup.org> | 2019-06-05 14:25:33 +0200 |
commit | 0ca84f52cddad0b9b93026b6ceb8749488dd79d7 (patch) | |
tree | 6a320b9194c254a7707e67096535fb6ceb7d956e /stdlib | |
parent | 79088fb09d23d6d8bde3258f856df2a1d6e31ddf (diff) | |
download | ocaml-0ca84f52cddad0b9b93026b6ceb8749488dd79d7.tar.gz |
Refactor the postponed blocks machinery in memprof.c
This makes sure that:
- Callbacks are never called when another is running
- The postponed queue is purged when setting memprof parameters
We now use a FIFO implemented as a circular buffer for remembering of
postponed blocks.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/gc.mli | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/stdlib/gc.mli b/stdlib/gc.mli index 2de9a5d8ee..f706dca23a 100644 --- a/stdlib/gc.mli +++ b/stdlib/gc.mli @@ -440,10 +440,12 @@ module Memprof : possible that a context switch occurs during a callback, in which case reentrancy has to be taken into account. - Note that when the callback kind is [Major], the callback can - be postponed after the actual allocation. Therefore, the - context of the callback may be slightly different than - expected. This should not happen if no C binding is used. *) + Note that the callback can be postponed slightly after the + actual allocation. Therefore, the context of the callback may + be slightly different than expected. + + In addition, note that calling [start] or [stop] in a callback + can lead to losses of samples. *) type 'a ctrl = { sampling_rate : float; |