caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mark Shinwell <Mark.Shinwell@cl.cam.ac.uk>
To: Christian Lindig <lindig@cs.uni-sb.de>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] how to enlarge header of blocks?
Date: Tue, 30 Aug 2005 12:16:24 +0100	[thread overview]
Message-ID: <20050830111624.GC5470@three-tuns.net> (raw)
In-Reply-To: <6a0d230d1d1dd537d5c33ff693437c84@cs.uni-sb.de>

On Sat, Aug 27, 2005 at 01:17:40PM +0200, Christian Lindig wrote:
> >What information do you wish to store?  Rather than adjusting the block
> >headers, it might be possible to simply tack it onto the end as extra
> >fields, provided those fields obey the GC structure constraints.
> 
> Currently I'd just like to store the address of the allocation site. 
> I've tried adding an extra field, hoping that the run-time system would 
> never access it. But either I did not get it right, or my assumptions 
> about the run-time system were too simple.

If the extra field obeys the GC structure constraints (see the Caml
documentation on interfacing to C) then you shouldn't have any
problem...
 
> As an alternative, one could maintain a table on the side that maps the 
> address of the block to whatever information is associated with it. But 
> since the garbage collector moves blocks, this isn't simple to 
> maintain, either.

Even if the GC were to correctly update the value pointers held in such
a table, such an approach would likely fail anyway as any such GC update
would break the invariants of the table (in particular if the value
pointers are acting as keys in a hashtable, where a change might mean
that values have to switch buckets).  There is the further difficulty
that registering many global memory roots should be avoided due to the
cost, which would affect the design of any such table.

Mark


  reply	other threads:[~2005-08-30 11:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-26  8:10 Christian Lindig
2005-08-26 11:34 ` [Caml-list] " Mark Shinwell
2005-08-27 11:17   ` Christian Lindig
2005-08-30 11:16     ` Mark Shinwell [this message]
2005-09-01  8:07       ` Christian Lindig
2005-09-01 11:53         ` Mark Shinwell

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=20050830111624.GC5470@three-tuns.net \
    --to=mark.shinwell@cl.cam.ac.uk \
    --cc=caml-list@inria.fr \
    --cc=lindig@cs.uni-sb.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).