This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: question: python gc doesn't collect buffer allocated by read_memory()


>>>>> ">" == HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> writes:

>> count = 100000
>> while count >= 0:
>>     i.read_memory(buf.address, buf.type.sizeof)
>>     count -= 1

You don't say what version of gdb you are using.
What you are reporting sounds like PR 12533, which was fixed in CVS back
in January.

>> 5. Looking at referrers of the buffer returned by read_memory(), they
>> are all empty [], so it looks OK to me if garbage collector collects
>> the memory...

In 12533 the problem was that intermediate values weren't properly
deallocated.

You could test for this problem by hoisting 'buf.address' out of the
loop and seeing if that has an effect.

Tom


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