caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
To: Damien Pous <Damien.Pous@inria.fr>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] hook before gc major collections
Date: Tue, 7 Oct 2014 11:01:58 +0200	[thread overview]
Message-ID: <CAHvkLrMBsst7St0GFNgp1B0PcyURxic15atcQznbL1OE-LGq6Q@mail.gmail.com> (raw)
In-Reply-To: <CAMy6byW5b_unsg-i8khBQ31KtjYB4kwn2DA6VzJBtdjn4adBtw@mail.gmail.com>

On Tue, Oct 7, 2014 at 10:05 AM, Damien Pous <Damien.Pous@inria.fr> wrote:
> 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 ;

Isn't *after* a major GC *before* the next one ? The major GC being
incremental, the major collection is almost always already started,
your code running between two slices of the same major collection. So,
it looks like this alarm is catching the only time between the last
slice of a major collection and the first slice of the next one.

--Fabrice

      parent reply	other threads:[~2014-10-07  9:02 UTC|newest]

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

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=CAHvkLrMBsst7St0GFNgp1B0PcyURxic15atcQznbL1OE-LGq6Q@mail.gmail.com \
    --to=fabrice.le_fessant@inria.fr \
    --cc=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).