caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@maxtal.com.au>
To: Damien Doligez <Damien.Doligez@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: finalisation
Date: Sat, 05 Feb 2000 05:36:20 +1100	[thread overview]
Message-ID: <389B1C24.E0A3055F@maxtal.com.au> (raw)
In-Reply-To: <200002041627.RAA17717@tobago.inria.fr>

Damien Doligez wrote:
> 
> >From: skaller <skaller@maxtal.com.au>

> If python specifies reference counting, I guess the only solution is
> to implement reference counting.  

	Python specifically _doesn't_ specify reference counting,
it specifies garbage collection. But the current implementation
is deficient in that it uses reference counting. So I need to
be compatible with existing programs at least as far as preserving
their correctness provided only that doesn't depend on synchronous
finalisation (a delay is OK, a change of order may not be).

>You can use O'Caml's finalisers to
> help you in the following way:
> 
> Add a reference count field to each finalisable object.  Initialise it
> to 1 upon allocation and register a finalisation function for this
> object.  Increment the reference count when you create a new reference
> from another finalised object, and decrement it when you remove a
> reference (you can do it by simply calling its finalisation function).

	I'm not sure how this works .. a reference from a finalised
object to another can be indirect (via another object). I'd like to
avoid
the cost of maintaining reference counts for non-finalisable objects.


-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
homepage: http://www.maxtal.com.au/~skaller
download: ftp://ftp.cs.usyd.edu/au/jskaller




  reply	other threads:[~2000-02-04 18:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-04 16:27 finalisation Damien Doligez
2000-02-04 18:36 ` skaller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-02-03 14:06 finalisation skaller

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=389B1C24.E0A3055F@maxtal.com.au \
    --to=skaller@maxtal.com.au \
    --cc=Damien.Doligez@inria.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;
as well as URLs for NNTP newsgroup(s).