caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* simulate class destructor
@ 2005-06-25  9:52 Pietro Abate
  2005-06-25 11:10 ` [Caml-list] " Stefano Zacchiroli
  0 siblings, 1 reply; 2+ messages in thread
From: Pietro Abate @ 2005-06-25  9:52 UTC (permalink / raw)
  To: ocaml ml

hi all,

Is it possible to simulate class destructor, that is convince Gc to call
a method before deallocating the object ? I'd like to take a closer look
at what's happening in my program to check if everything works at it
should... I've a NodeCounter module with a counter that increase every
time I create a new object, now I'd like to decrement the counter when
the object is de-allocated. Impossible ?

:)
p

-- 
++ Blog: http://blog.rsise.anu.edu.au/?q=pietro
++ 
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] simulate class destructor
  2005-06-25  9:52 simulate class destructor Pietro Abate
@ 2005-06-25 11:10 ` Stefano Zacchiroli
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Zacchiroli @ 2005-06-25 11:10 UTC (permalink / raw)
  To: Inria Ocaml Mailing List; +Cc: Pietro Abate

On Sat, Jun 25, 2005 at 07:52:07PM +1000, Pietro Abate wrote:
> Is it possible to simulate class destructor, that is convince Gc to call
> a method before deallocating the object ? I'd like to take a closer look
> at what's happening in my program to check if everything works at it
> should... I've a NodeCounter module with a counter that increase every
> time I create a new object, now I'd like to decrement the counter when
> the object is de-allocated. Impossible ?

Gc.finalise

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-25 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-25  9:52 simulate class destructor Pietro Abate
2005-06-25 11:10 ` [Caml-list] " Stefano Zacchiroli

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).