caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Pous <Damien.Pous@inria.fr>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] hook before gc major collections
Date: Tue, 7 Oct 2014 10:05:15 +0200	[thread overview]
Message-ID: <CAMy6byW5b_unsg-i8khBQ31KtjYB4kwn2DA6VzJBtdjn4adBtw@mail.gmail.com> (raw)

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

             reply	other threads:[~2014-10-07  8:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07  8:05 Damien Pous [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMy6byW5b_unsg-i8khBQ31KtjYB4kwn2DA6VzJBtdjn4adBtw@mail.gmail.com \
    --to=damien.pous@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).