[fpc-devel] Class management operators

Sven Barth pascaldragon at googlemail.com
Sun May 26 10:02:00 CEST 2019

Ryan Joseph <ryan at thealchemistguild.com> schrieb am Sa., 25. Mai 2019,

> > On May 24, 2019, at 2:46 PM, Sven Barth via fpc-devel <
> fpc-devel at lists.freepascal.org> wrote:
> >
> > Object Pascal isn't a full ARC language however. Also it is not
> something that one can enable on a whim cause it also affects other parts.
> Isn’t that how the ref counted compilers types like pchar work? I was
> thinking enabling management operators for classes would have basically the
> same performance impact as those compiler types (which is actual ARC in
> Pascal unless I misunderstand).

First of as Marco said PChar isn't a managed type.

Second especially for the simple types (so no records, no matter if
management operator or not) the compiler calls direct helper functions that
deal with the reference count management being much faster than what is
routed through the RTL's functionality.

Thus, if we would decide to implement ARC for classes we would integrate
directly inside the compiler, cause there would be no need for user
management (Create and Destroy have the role of the Initialize and Finalize
operators). An experiment for this you can see in my old ARC branch which
used a keyword (and had similar problems for passing to non-ARC classes,
though it allowed to manually increase/decrease the reference count as
well): https://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/svenbarth/arc/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190526/2b741a95/attachment.html>

More information about the fpc-devel mailing list