[squid-dev] [PATCH] turn mempools' delete(nullptr) into NOP
Amos Jeffries
squid3 at treenet.co.nz
Wed Sep 30 01:36:45 UTC 2015
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
More information about the squid-dev
mailing list