[squid-dev] [PATCH] TidyPointer removal

Alex Rousskov rousskov at measurement-factory.com
Fri Jul 8 21:45:36 UTC 2016


On 07/08/2016 04:11 AM, Amos Jeffries wrote:
> On 8/07/2016 6:44 p.m., Amos Jeffries wrote:
>> On 8/07/2016 11:24 a.m., Alex Rousskov wrote:
>>>
>>>>  typedef void* SessionPtr;
>>>> +CtoCpp1(xfree, SessionPtr);
>>>
>>> xfree() is already a C++ function and does not need wrapping, right?

> It seems the answer is no.

This is minor, of course, but it is wrong to wrap a C++ xfree() with
CtoCpp1(), even if some kind of wrapping is needed.


> "
> src/security/Session.h:53:39: error: could not convert template argument
> ‘xfree’ to ‘void (*)(void*)’
>  typedef LockingPointer<void, xfree, -1> SessionPointer;
> "

> I believe its failing due to being an inline. 

The wrapper produced by CtoCpp1() is also "an inline"...

It could be the "const" in xfree() argument, which is itself a major API
bug, of course.

Alex.



More information about the squid-dev mailing list