caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@maxtal.com.au>
To: caml-list@inria.fr
Subject: Finalisation in 2.02
Date: Sun, 12 Dec 1999 14:38:03 +1100	[thread overview]
Message-ID: <3853189B.86E5EBFE@maxtal.com.au> (raw)

I'm still using ocaml 2.02, and have encountered what looks like a bug,
although perhaps it is my understanding, and perhaps it is fixed
in 2.04, or will be in 3.

The problem is that when I create an object with alloc_final(_,_,0,1),
the finaliser is not called on termination. Using 1,1 seems to cause
it to be called almost immediately. [I seem to also get this
behaviour with output to stdout -- I have to flush the file
after every write, in case an exception terminates the program,
and these debugging writes are there precisely to track this]

I'm modifying mlgtk by boxing GtkObjects, this seems necessary
to allow the collector to call the finaliser which decrements
the reference count -- however, at least the memory of the object
doesn't seem to be released when caml terminates.

Does 0,1 mean 'never bother calling the finaliser,
there is nothing to finalise'? That makes mathematical
sense (but isn't what I expected, since the documentation
advises to use this setting if you aren't sure).

Perhaps I should force a full GC collection, just before
termination? 

BTW: I would like to reinforce comments that ocaml is
easy to interface! In fact, it is easier than Python
or Tcl (I have extensive experience with both).
I don't claim to really understand everything yet --
but I seem to be able to get code working very quickly.

-- 
John Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
voice: 61-2-9660-0850




             reply	other threads:[~1999-12-12 22:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-12  3:38 skaller [this message]
1999-12-13  9:35 ` Jacques Garrigue
1999-12-15  8:41   ` Patrick Goldbronn - SYSCO
1999-12-13 12:50 Damien Doligez
1999-12-23 17:06 Damien Doligez

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=3853189B.86E5EBFE@maxtal.com.au \
    --to=skaller@maxtal.com.au \
    --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).