Steve, I apologize that what I wrote wasn't clear. Pre-allocation simply means to allocate space BEFORE you need it. And all that means is that the FIRST allocation doesn't occur at init time, but WAITS until you actually put something in the string or container. From that point of view pre-allocation is NEVER required. As I said, the capacity argument MUST BE RESPECTED at the point of the first allocation, whenever that occurs, and at all following re-allocations. My assumption has always been that the capacity increment of each subsequent allocation may grow from the initial capacity size.
Tom Wetmore On Aug 22, 2013, at 1:43 PM, Steve Mills <[email protected]> wrote: > On Aug 22, 2013, at 12:31:55, Thomas Wetmore <[email protected]> > wrote: > >> Pre-allocation doesn't really matter as long as the re-allocations, whenever >> they occur, respect the capacity argument. > > Sure they do. If you don't preallocate, but instead keep appending, and the > pointer needs to grow with every append, it *could* reallocate with every > append. > > -- > Steve Mills > office: 952-818-3871 > home: 952-401-6255 > cell: 612-803-6157 > > > > _______________________________________________ > > Cocoa-dev mailing list ([email protected]) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/ttw4%40verizon.net > > This email sent to [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
