[fpc-pascal] String conversions
Martok
listbox at martoks-place.de
Fri Jun 28 21:40:22 CEST 2019
> 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.
More information about the fpc-pascal
mailing list