View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] results of the poll

From: Zoran Vasiljevic <zoran_at_archiware.com>
Date: Mon, 4 Mar 2002 18:21:42 +0100

On Monday 04 March 2002 14:08, Gustaf Neumann wrote:

> From the "volatile" front: we have now more-or-less Zoran

Smile !

> suggestion implemented in C. Actually there is no need
> in general for using tcl-variables to implement volatile
> objects (we could handle this on a pop of stack frames),
> but at least for pure tcl-procs, var traces are the simplest
> implementation. The current implementation (purely in C)

It is not clear: does the C implementation use internal stack
for garbage collection or the Tcl-trace variable mechansim?
It is important to know when doing (or not doing!) such
constructs:

Class foo
foo instproc test args {}

[foo new -volatile] test ; # object leak ?

In case of volatile implementation with var traces,
one should do:

set bar [foo new -volatile]
$bar test
 
to be sure that when "bar" is unset, the object goes away.

So, which way is it?


Cheer's
Zoran