From: "François Bobot" <francois.bobot@cea.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] One more question about Gc.finalise
Date: Mon, 19 Jun 2017 08:02:55 +0200 [thread overview]
Message-ID: <d5f7ab54-4cd6-d655-7cf8-aaddcc8d016e@cea.fr> (raw)
In-Reply-To: <CAGYXaSamWJCQyYqqa934mpEk=zf+TDGd5WXKPHQGhio54GyayA@mail.gmail.com>
Hi,
Le 19/06/2017 à 01:45, Evgeny Roubinchtein a écrit :
> I have one more question about Gc.finalise to which I couldn't find an answer in the documentation.
> Suppose I do, "Gc.finalise f v", and the function f makes the value v reachable again. If I want f
> to be called again should v become unreachable again, do I need to again call "Gc.finalise f v",
> after f has "revived" v?
I think so, but I didn't double checked with the code.
>
> My experimentation _seems_ to suggest that I do, but there is always the danger that I am
> misinterpreting the results of my experiment. :-)
With newer ocaml version (>= 4.04), you can use `GC.finalise_last` which can't use the value
finalised (unit instead of 'a is given to the function `f`) but the function `f` will really be
called after `v` is unreachable for the last time, just before being reclaimed. Perhaps it could fit
better what you have in mind.
Best,
--
François
next prev parent reply other threads:[~2017-06-19 6:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-18 23:45 Evgeny Roubinchtein
2017-06-19 6:02 ` François Bobot [this message]
2017-06-19 12:04 ` Jacques-Henri Jourdan
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=d5f7ab54-4cd6-d655-7cf8-aaddcc8d016e@cea.fr \
--to=francois.bobot@cea.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