Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-11 Thread Alex Rousskov
On 11/11/2016 01:30 AM, Kinkie wrote: > On Fri, Nov 11, 2016 at 5:02 AM, Amos Jeffries wrote: >> On 11/11/2016 9:28 a.m., Kinkie wrote: >>> >>> v4 attached. >>> >> >> Does it have to take begin() and end() iterators explicitly? >> can we not have it take the container

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-11 Thread Kinkie
On Fri, Nov 11, 2016 at 5:02 AM, Amos Jeffries wrote: > On 11/11/2016 9:28 a.m., Kinkie wrote: >> >> v4 attached. >> > > Does it have to take begin() and end() iterators explicitly? > can we not have it take the container itself and use a for(auto : > container) loop ? No

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-10 Thread Amos Jeffries
On 11/11/2016 9:28 a.m., Kinkie wrote: > > v4 attached. > Does it have to take begin() and end() iterators explicitly? can we not have it take the container itself and use a for(auto : container) loop ? Amos ___ squid-dev mailing list

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-10 Thread Kinkie
> Tests and code analysis show that JoinContainerIntoSBuf() allocates when > no allocation is needed. I have also shown that it is possible to > implement JoinContainerIntoSBuf() so that there is no extra allocation. > AFAICT, going forward, you choices are: > > * state that the extra allocation

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-06 Thread Alex Rousskov
On 11/06/2016 01:15 AM, Kinkie wrote: >>> +dest.reserveSpace(prefix.length() + totalContainerSize + >>> suffix.length()); >> >> Please note that v4 still allocates memory according to my last >> experiment. See JoinContainerIntoSBuf3() which mimics your patch v4. You >> may claim that the

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-06 Thread Kinkie
>> +dest.reserveSpace(prefix.length() + totalContainerSize + >> suffix.length()); > > Please note that v4 still allocates memory according to my last > experiment. See JoinContainerIntoSBuf3() which mimics your patch v4. You > may claim that the unnecessary allocation is not the fault of this

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-05 Thread Kinkie
On Fri, Nov 4, 2016 at 6:12 PM, Alex Rousskov wrote: > On 11/04/2016 01:12 AM, Kinkie wrote: >> On Thu, Nov 3, 2016 at 10:55 PM, Alex Rousskov >> wrote: >>> On 11/03/2016 03:19 PM, Kinkie wrote: On Tue, Nov 1, 2016 at 8:47

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-04 Thread Alex Rousskov
On 11/04/2016 01:12 AM, Kinkie wrote: > On Thu, Nov 3, 2016 at 10:55 PM, Alex Rousskov > wrote: >> On 11/03/2016 03:19 PM, Kinkie wrote: >>> On Tue, Nov 1, 2016 at 8:47 PM, Alex Rousskov wrote: On 11/01/2016 02:02 PM, Kinkie wrote: > the attached patch

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-04 Thread Kinkie
On Thu, Nov 3, 2016 at 10:55 PM, Alex Rousskov wrote: > On 11/03/2016 03:19 PM, Kinkie wrote: >> On Tue, Nov 1, 2016 at 8:47 PM, Alex Rousskov wrote: >>> On 11/01/2016 02:02 PM, Kinkie wrote: the attached patch extends SBufContainerJoin to have prefix and

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-03 Thread Alex Rousskov
On 11/03/2016 03:19 PM, Kinkie wrote: > On Tue, Nov 1, 2016 at 8:47 PM, Alex Rousskov wrote: >> On 11/01/2016 02:02 PM, Kinkie wrote: >>> the attached patch extends SBufContainerJoin to have prefix and >>> suffix arguments. >> I recommend reworking this by adding a dest parameter: >> SBuf

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-03 Thread Kinkie
On Tue, Nov 1, 2016 at 8:47 PM, Alex Rousskov wrote: > On 11/01/2016 02:02 PM, Kinkie wrote: >> the attached patch extends SBufContainerJoin to have prefix and >> suffix arguments. This can support a use-case which I found in the >> current ACLRegexData work

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-01 Thread Alex Rousskov
On 11/01/2016 02:02 PM, Kinkie wrote: > the attached patch extends SBufContainerJoin to have prefix and > suffix arguments. This can support a use-case which I found in the > current ACLRegexData work I'm following, where we need to transform > {"foo", "bar", "gazonk"} > into >

[squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-01 Thread Kinkie
Hi all, the attached patch extends SBufContainerJoin to have prefix and suffix arguments. This can support a use-case which I found in the current ACLRegexData work I'm following, where we need to transform {"foo", "bar", "gazonk"} into (foo)|(bar)|(gazonk) It can be done with the current