<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> schrieb am Sa., 25. Mai 2019, 19:55:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On May 24, 2019, at 2:46 PM, Sven Barth via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>> wrote:<br>
> <br>
> 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. <br>
<br>
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).<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">First of as Marco said PChar isn't a managed type. </div><div dir="auto"><br></div><div dir="auto">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. </div><div dir="auto"><br></div><div dir="auto">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): <a href="https://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/svenbarth/arc/">https://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/svenbarth/arc/</a></div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>