caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus.mottl@gmail.com>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Why is struct caml_ba_proxy allocated outside the GC heap and why doesn't it have a finalizer?
Date: Sat, 1 Feb 2014 21:06:54 -0500	[thread overview]
Message-ID: <CAP_800qpOzaTYSvz806tfsXxxCx0fs0dNAzoe51NykpoChd+Eg@mail.gmail.com> (raw)
In-Reply-To: <20140202013846.GA11002@frosties>

On Sat, Feb 1, 2014 at 8:38 PM, Goswin von Brederlow <goswin-v-b@web.de> wrote:
> The GC knows which pointers point inside the GC heap and which point
> outside. So there is no problem there. The pointer must just not exist
> after the destination has been freed or it might accidentaly point to
> inside the next GC heap. Can't happen in this use case.

Exactly.  Though the GC checks whether a pointer actually points into
the OCaml heap before following it, it does require some care to
guarantee that the pointer, if still reachable by the GC, is
invalidated (e.g. set to NULL) before associated memory is freed.
This may indeed not be that hard to achieve for the bigarray module.
I still prefer 2), which would also be easier to add to the current
implementation without breaking existing code.

Regards,
Markus

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com

  reply	other threads:[~2014-02-02  2:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-01 16:42 Goswin von Brederlow
2014-02-01 20:49 ` Markus Mottl
2014-02-02  1:38   ` Goswin von Brederlow
2014-02-02  2:06     ` Markus Mottl [this message]
2014-02-04 15:32       ` Goswin von Brederlow

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=CAP_800qpOzaTYSvz806tfsXxxCx0fs0dNAzoe51NykpoChd+Eg@mail.gmail.com \
    --to=markus.mottl@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=goswin-v-b@web.de \
    /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).