Re: Project idea: strbuf allocation modes

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

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> On 04/18/2014 07:21 PM, Junio C Hamano wrote:
>> Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:
>> 
>>> The Idea
>>> ========
>>>
>>> I would like to see strbuf enhanced to allow it to use memory that it
>>> doesn't own (for example, stack-allocated memory), while (optionally)
>>> allowing it to switch over to using allocated memory if the string grows
>>> past the size of the pre-allocated buffer.
>> 
>> I'd like to see these characteristics, but I would want to see that
>> this is done entirely internally inside the strbuf implementation
>> without any API impact, other than the initialisation.  I do not
>> ...
>
> I think that's exactly what I described.  The only thing that would have
> to change in the strbuf behavior (aside from initialization) is that a
> buffer-growing operation might die if the string would grow outside of
> the bounds of the existing buffer when STRBUF_FIXED_MEMORY is set.

Yup, we are in agreement ;-)

More seriously, sorry for sounding as if I was objecting. I should
have edited s/but/and/ before sending my response out.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]