GC In Python: YAS (Yet Another Summary)

Andrew Dalke dalke at bioreason.com
Fri Jun 25 17:09:11 EDT 1999


Stuart Yeates <syeates at cs.waikato.ac.nz> said to me:
> I'm not quite sure what you mean by 'integer handle,' but if you
> do a straight cast then it shouldn't be a problem (since the 
> collector operates on the binaries representation). If you mean
> that it uses an index to an array of pointers (or some such), 
> then that shouldn't be a problem either, since the pointer still
> exists somewhere (i.e. the array). 

The latter.   Example object creation code might look like:

dt_Handle mol = dt_smilin("CCC", 3);

where dt_Handle is a typedef to unsigned long.  In the SWIGged
wrapped version, this is mol = dt_smilin("CCC").

Yes, the library has a pointer table to the object.  The problem
I see is, how does the Boehm collector (or other GC) know what to
collect from this vendor library?  I can't see how, given that
my Python code stores it as an integer.

That's why I don't see how you say "It fully supports C and C++"
when this is a package which doesn't do "pointer XORing or other
crimes" but cannot be usable with a GC w/o modifications.

But then, I'm a computational biophysicist by training and don't
know much about GC other than the general concepts.  One of the
references on the SGI page says Boehm can be used in "uncooperative
environments" so I'll end by saying that I don't know enough.

						Andrew Dalke
						dalke at bioreason.com




More information about the Python-list mailing list