[mi] kill release_value calls

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[mi] kill release_value calls

Vladimir Prus

This patch removes all calls to release_value in varobj.c, except
for one. We only need to call release_value when we're storing
a value for indefinite future use, and install_new_value is the
only such place.  The extra release_value calls either
are time-consuming no-ops, or lead to memory leaks,
depending on the value type.

OK?

- Volodya

        * varobj.c (c_value_of_root, c_value_of_child)
        (cplus_value_of_child): Don't call release_value.


release_value__gdb_mainline.diff (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [mi] kill release_value calls

Daniel Jacobowitz-2
On Wed, Jan 24, 2007 at 10:33:30PM +0300, Vladimir Prus wrote:
>
> This patch removes all calls to release_value in varobj.c, except
> for one. We only need to call release_value when we're storing
> a value for indefinite future use, and install_new_value is the
> only such place.  The extra release_value calls either
> are time-consuming no-ops, or lead to memory leaks,
> depending on the value type.
>
> OK?

OK.  My apologies to Nick - I'd told him this was wrong, but I was
mistaken.

--
Daniel Jacobowitz
CodeSourcery
Reply | Threaded
Open this post in threaded view
|

Re: [mi] kill release_value calls

Vladimir Prus
Daniel Jacobowitz wrote:

> On Wed, Jan 24, 2007 at 10:33:30PM +0300, Vladimir Prus wrote:
>>
>> This patch removes all calls to release_value in varobj.c, except
>> for one. We only need to call release_value when we're storing
>> a value for indefinite future use, and install_new_value is the
>> only such place.  The extra release_value calls either
>> are time-consuming no-ops, or lead to memory leaks,
>> depending on the value type.
>>
>> OK?
>
> OK.  My apologies to Nick - I'd told him this was wrong, but I was
> mistaken.
Here's what I've checked in -- I had to adjust the patch
for the changes I've checked to mainline earlier today.

- Volodya


release_value_as_committed.diff (1K) Download Attachment