[squid-dev] [PATCH] turn mempools' delete(nullptr) into NOP

Kinkie gkinkie at gmail.com
Wed Sep 30 12:23:39 UTC 2015


Hi,
  v2 patch attached.

On Wed, Sep 30, 2015 at 3:36 AM, Amos Jeffries <squid3 at treenet.co.nz> wrote:
> On 30/09/2015 11:42 a.m., Alex Rousskov wrote:
>>
>> I believe you have correctly modified the wrong code. STL allocators
>> throw when fed a null pointer[2]. Our allocators should [continue to] do
>> the same. The logic behind STL design makes sense to me: The reasoning
>> behind allowing "delete null" differs a lot from the reasoning behind
>> allowing Allocator::deallocate(null) IMHO!
>>
>> I recommend modifying MEMPROXY_CLASS delete() to comply with [1] by not
>> feeding the allocator object with invalid information.
>>
>
> Yes.
>
> kinkie: I was talking about the custom inline delete operator in the
> macro itself accepting nullptr.
>
> Amos
>
> _______________________________________________
> squid-dev mailing list
> squid-dev at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-dev



-- 
    Francesco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delete-nullptr-nop-v2.patch
Type: text/x-diff
Size: 504 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150930/5be0caf7/attachment.patch>


More information about the squid-dev mailing list