Re: [PATCH v5 2/6] Add tree cmd support for maple tree

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

 



On 2023/01/12 9:59, HAGIO KAZUHITO(萩尾 一仁) wrote:
> On 2023/01/12 0:30, Tao Liu wrote:
>>>> @@ -275,6 +283,49 @@ static void do_mt_entry(ulong entry, ulong min, ulong max, uint depth,
>>>>
>>>>           if (!td)
>>>>                   return;
>>>> +
>>>> +       if (!td->count && td->structname_args) {
>>>> +               /*
>>>> +                * Retrieve all members' info only once (count == 0)
>>>> +                * After last iteration all memory will be freed up
>>>> +                */
>>>> +               e = (struct req_entry **)GETBUF(sizeof(*e) * td->structname_args);
>>>
>>>
>>> I would suggest freeing the allocated memory for "e" at the end of this function.
>>
>> I think free "e" at the end of the function is reasonable. By a quick
>> glimpse, it seems that do_xarray_entry() and do_rdtree_entry() etc.
>> have the similar issue?
> 
> Ah yes, they have.  But all buffers allocated by GETBUF() are
> automatically freed after finishing a command, so it's not an actual
> problem if you don't use more buffers than the limitation (about 2000+).
> So there is no big necessity to fix them alone in this case IMHO.
> 
>>>
>>> Can you help to add the FREEBUF() as below? Kazu.
>>> +     if (e)
>>> +        FREEBUF(e);
> 
> Sure, I'll do that.  Please wait for a while.

ok, applied with those and commit log tweaks.

Thanks!
Kazu

> 
>>>
>>> Other changes look good to me, for the v5 with the minor modification: Ack.
> 
> Also thank you for your effective reviews, Lianbo.
> 
> Thanks,
> Kazu
> --
> Crash-utility mailing list
> Crash-utility@xxxxxxxxxx
> https://listman.redhat.com/mailman/listinfo/crash-utility
> Contribution Guidelines: https://github.com/crash-utility/crash/wiki
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux