This is the mail archive of the mailing list for the Archer project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [python] don't try to free "independent" types

>>>>> "Chris" == Chris Moller <> writes:

Tom> After considering this for a while I arrived at the conclusion that,
Tom> short of a value-and-type garbage collector, there is not much that
Tom> can be done.

Chris> Any way to implement reference counts with a free-on-count-equal-zero
Chris> sort of thing?  (This may be a phenomenally bone-headed suggestion--I
Chris> don't know a thing about python.  If it is, consider it the
Chris> chuckle-du-jure.)

It isn't boneheaded.  However, is what the code did before the patch.

The problem is that only the Python layer was using reference counting
(and not even consistently, as the Value.type example shows).
However, there were cases where the underlying type could leak out,
like the script in the message.

FWIW pure reference counting won't work even if we applied it to all
of gdb, because types are recursive.  E.g., a struct type can have a
field whose type is a pointer to the struct.

But, maybe some hybrid scheme could work.  I tend to just treat
reference counting as a particular style of GC, my word choice there
wasn't meant to imply a particular implementation.  The difficult bit,
as I see it, is that it would have to be used consistently in gdb, and
that implies a fairly invasive change.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]