[Lazarus] dynamic string proposal
Michael Schnell
mschnell at lumino.de
Thu Aug 17 14:51:44 CEST 2017
On 17.08.2017 14:43, Sven Barth via Lazarus wrote:
>
> Yes it does, because without optimizations implemented and enabled the
> compiler would need to do this for each element access.
>
But it does not need to do a function call. If getting the element size
of a string is a pascal function it would be built-in.
Moreover I suppose (or suggest) that pos() is a built-in function that
in fact can use decently optimized code.
Also a library function could use optimized pascal code that reads the
element size, stores it in a variable and uses a pointer within the loop.
Of course a user function would just do s[x] and see some degradation.
-Michael
More information about the Lazarus
mailing list