On Fri, Aug 31, 2018 at 8:43 AM, Henri Sivonen wrote:
> At this point, it's probably relevant to mention that SetCapacity() in
> situations other that ahead of a sequence of Append()s is most likely
> wrong (and has been so since at least 2004; I didn't bother doing code
> archeology further back
On Thu, Aug 30, 2018 at 7:43 PM, Henri Sivonen wrote:
>> What is then the point of SetCapacity anymore?
>
> To avoid multiple allocations during a sequence of Append()s. (This is
> documented on the header.)
At this point, it's probably relevant to mention that SetCapacity() in
situations other t
On Thu, Aug 30, 2018 at 6:00 PM, smaug wrote:
> On 08/30/2018 11:21 AM, Henri Sivonen wrote:
>>
>> We have the following that a pattern in our code base:
>>
>> 1) SetCapacity(newCapacity) is called on an XPCOM string.
>> 2) A pointer obtained from BeginWriting() is used for writing more
>> tha
On 08/30/2018 11:21 AM, Henri Sivonen wrote:
We have the following that a pattern in our code base:
1) SetCapacity(newCapacity) is called on an XPCOM string.
2) A pointer obtained from BeginWriting() is used for writing more
than Length() but no more than newCapacity code units to the XPCOM
We have the following that a pattern in our code base:
1) SetCapacity(newCapacity) is called on an XPCOM string.
2) A pointer obtained from BeginWriting() is used for writing more
than Length() but no more than newCapacity code units to the XPCOM
string.
3) SetLength(actuallyWritten) is called
5 matches
Mail list logo