On 28.04.2009 20:31, Nagy József wrote:
> Hi all,
> 
> what happeining, when I call the SetCapacity() function of the
> csStringFast class?
> Is the following code  problem free?
> 
> csStringFast<256> my_string;
> mystring.SetCapacity(500);

Note that if you call SetCapacity() on the string right away with a size
bigger than the size of the interal buffer you'll basically enforce an
allocation on the heap. So using csStringFast<> as such is somewhat
pointless as the internal buffer takes up space but is never used; you
can either get rid of the csStringFast<> (and use csStringBase) or set a
higher internal buffer size (say, 500, if you start of with that
capacity anyway).

-f.r.

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: 
mailto:[email protected]?subject=unsubscribe

Reply via email to