[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ extension and garbage collection



At Wed, 27 Mar 2002 08:58:05 -0800 (PST), Ron Stanonik wrote:
> That's an interesting remark.  I've noticed that new structures seem
> to be collected, but new classes don't seem to be collected, even if
> they contain the same structure.  For example
> 
>   new Tcl_HashTable
> 
> gets collected, but
> 
>   new Pad_HashTable
> 
> doesn't, even though it contains a Tcl_HashTable.
> 
> class Pad_HashTable {
>  ...
>  private:
>    Tcl_HashTable table;
> }
> 
> Why are new structures collected, but not new classes?
> From gdb it appears the same new is used.

I'm not sure. Could it just be the timing of collections? (The pointer
to a Pad_HashTable happens to be in a register or on the stack?)

Matthew