caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: jonathan.roewen@gmail.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Weak module
Date: Mon, 24 Jul 2006 13:33:34 +0900 (JST)	[thread overview]
Message-ID: <20060724.133334.155807697.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <54440253999-BeMail@beos>

From: "Jonathan Roewen" <jonathan.roewen@gmail.com>
> For the weak module, if some value is pointing to another value which 
> is in a weak array, can that value be erased by the Gc still?
> 
> e.g. type my_t = (int32, int32_elt, c_layout) Array1.t (* bigarray *)
> 
> and I had a weak array of my_t, and was holding on to an int32 inside 
> the bigarray...

You cannot hold on to anything inside a bigarray: this is just an
array of bytes where you read and write data. A new int32 block is
allocated every time you extract a value from the bigarray.
Note that the same thing is true for a "float array": it is not an
array of pointers to floats, but a flat array of doubles.
In both cases, a pointer to the value you wrote in the array may be
disposed of afterwards, if nobody else keeps it.

Jacques Garrigue


      reply	other threads:[~2006-07-24  4:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-24  2:35 Jonathan Roewen
2006-07-24  4:33 ` Jacques Garrigue [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=20060724.133334.155807697.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=jonathan.roewen@gmail.com \
    /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).