[PATCH] Ensure entries pid_map are initialized to NULL

Richard Guenther richard.guenther@gmail.com
Wed Aug 5 22:05:00 GMT 2009


On Wed, Aug 5, 2009 at 11:59 PM, Xinliang David Li<davidxl@google.com> wrote:
> On Wed, Aug 5, 2009 at 2:54 PM, Diego Novillo<dnovillo@google.com> wrote:
>> On Wed, Aug 5, 2009 at 17:52, Xinliang David Li<davidxl@google.com> wrote:
>>
>>>> I've just noticed that we never free pid_map.  What would be a good
>>>> place to do that?  This is not related to this change, so if you find
>>>> a good spot, it can be done in a separate patch.
>>>
>>> This is not uncommon for objects with global life time. Other examples
>>> include cgraph nodes, varpool nodes etc.
>>
>> No.  These live in GC memory.
>
> Yes -- the strange thing is that cgraph maintain its own memory
> management by using a free nodes list -- so there are no chances they
> can be GCed.

IIRC it's to be able to re-use node uids and thus keep them dense.

Richard.

> David
>
>>  pid_map lives on the heap.  We leak
>> memory left-right-and-center, so I don't think it's critical.
>
>>
>>
>> Diego.
>>
>



More information about the Gcc-patches mailing list