[Xotcl] Garbage Collection
mail at xdobry.de
Tue May 22 21:41:30 CEST 2001
Thanks for good resource tip to Kristoffer Lawson.
There are good publication at
The Feather tcl extension seems to be very interesting.
It is shame it was published only as Windows binary
(Kann ein Mensch so tief sinken?)
I have made first attempt to implement it and I have noticed
one big Problem.
source as Xotcl extension
(copy in xotcl/src and make -f XRMakefile)
set a [A newReference]
$a set var value
by last line the tcl interpreter try to convert my new type
to Tcl_ObjType tclCmdNameType
by this operation the internal representation is freed.
And so the object is deleted before I can use it as command
There can be 2 solution on this problem
1. Special invoke of referenced objects
invokeRef $a set var value
it is probably also used by Feather extension.
2. Overwrite the interal pointers of Tcl_ObjType tclCmdNameType
SetCmdNameFromAny see tcl sources generic/tclExecute.c
it should not freed our new Tcl_ObjType XOTclReferenceObjectType
So I give up. These two solution does not seems to be acceptable.
Maybe futures version of tcl interpeters will offer more flexible
type conversion solution. The new type should decide by itself
how it can be converted to another type.
More information about the Xotcl