[fpc-pascal] FPC + Mobile development: the String type
Jonas Maebe
jonas.maebe at elis.ugent.be
Thu Jul 10 15:15:36 CEST 2014
On 10 Jul 2014, at 14:39, Marco van de Voort wrote:
> In our previous episode, leledumbo said:
>> I hope so, and with Delphi plans on making strings immutable in the
>> future,
>> I hope FPC doesn't follow.
>
> (doesn't it already for the jvm port?)
No, but changing an individual character of a unicodestring is
obviously very inefficient there. Changing an individual character of
an ansistring however is just as inefficient on the JVM target,
because there's no way to keep track of or request the reference count
at the RTL level, so we always have to make a deep copy.
Many of those cases, especially the critical ones in tight loops, can
in theory be optimised by the compiler (which would also result in a
speedup on other platforms, because it would eliminate a lot of
automatically inserted uniquestring calls), but there's no support for
that yet.
Jonas
More information about the fpc-pascal
mailing list