> Yes indeed. FPC already has an overwhelming amount of string types. As I said > though a SetCapacity option for growing would be nice (for dynamic arrays > also) because += is such a common operation. As it stands I often don’t use > dynamic arrays (and now ansistring) because of growing limitations, which is > a shame really.
Just chiming in: this should be handled by the memory manager. "A chunk of memory gets grown repeatedly" is actually a fairly common workload, not just for arrays, but also things like MemoryStreams or List classes. So, I would expect (and FastMM has codepaths for that), that repeated reallocations cause some form of "over-allocating" growth and most of the individual "+1" reallocs will be essentially no-ops. -- Regards, Martok Ceterum censeo b32079 esse sanandam. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal