From: Goswin von Brederlow <goswin-v-b@web.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] memory corruption with Weak.t in Gc.finalise
Date: Tue, 15 Mar 2016 10:43:45 +0100 [thread overview]
Message-ID: <20160315094344.GA2468@frosties> (raw)
In-Reply-To: <56E6EA6C.8090605@cea.fr>
On Mon, Mar 14, 2016 at 05:44:28PM +0100, François Bobot wrote:
> On 14/03/2016 11:32, Goswin von Brederlow wrote:
> >
> >Still using 4.02. This is a new thing.
> >
> >Still Weak.t needs to interact cleanly with the Gc. Guessing at the
> >internal state of Weak.t is bad. Let's fix this for 4.03.
>
> I think it is already fixed for 4.03. The new GC phase named "clean",
> between mark and sweep, makes the behavior of weak pointers straightforward
> compared to previous OCaml version:
> - A weak pointer is unset only if the value pointed is marked dead after
> the mark phase (ie. no way to ever access it, the memory could be freed).
> - Conversely, during the clean phase, a weak pointer to a dead value is
> considered unset (so Weak.get return None).
>
> If you know weird behavior in 4.03+beta on weak pointers or ephemeron, I
> would be very interested to know them.
>
> Best,
I heard about that design cleanup. But what I ment was to provide and
document an interface for C code interacting with Weak.t.
MfG
Goswin
prev parent reply other threads:[~2016-03-15 9:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-08 15:49 Goswin von Brederlow
2016-03-08 16:00 ` Gabriel Scherer
2016-03-08 19:04 ` Goswin von Brederlow
2016-03-11 15:05 ` François Bobot
2016-03-14 10:32 ` Goswin von Brederlow
2016-03-14 16:44 ` François Bobot
2016-03-15 9:43 ` Goswin von Brederlow [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=20160315094344.GA2468@frosties \
--to=goswin-v-b@web.de \
--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