caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] hook before gc major collections
@ 2014-10-07  8:05 Damien Pous
  2014-10-07  8:09 ` Nicolas Boulay
  2014-10-07  9:01 ` Fabrice Le Fessant
  0 siblings, 2 replies; 5+ messages in thread
From: Damien Pous @ 2014-10-07  8:05 UTC (permalink / raw)
  To: caml-list

Hello,

Is there a way to register a function, to be called before each gc
major collection ?
(I have some cache tables which I'd like to empty from time to time -
I'm not sure this is a good idea, but I would like to experiment it.)

I see two related functions in the std lib, but not the precise thing I want:
- Gc.create_alarm, to register a function to be called *after* such
collections ;
- Gc.finalise, which I could use with a dummy heap allocated value,
but then I guess my function would be called before any gc *minor*
collection, which is certainly too often in my concrete use-case.

Thanks in advance,
Damien

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-07  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-07  8:05 [Caml-list] hook before gc major collections Damien Pous
2014-10-07  8:09 ` Nicolas Boulay
2014-10-07  8:42   ` Damien Pous
2014-10-07  9:12     ` Virgile Prevosto
2014-10-07  9:01 ` Fabrice Le Fessant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).