<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial'; COLOR: #000000">
<DIV>This is a valid point.</DIV>
<DIV>The only downside is that the object will every time do a deep copy versus
a shallow (pointer only) copy. Deep copy is very, very expensive
operation.</DIV>
<DIV>Adding ref. counting to objects is probably equivalent of one interlocked
assembly instruction, so a very small difference, probably not even
measurable.</DIV>
<DIV>Copy of a large object can take a large memory transfer, and will also
reserve memory for each copy, thus significantly increasing memory.</DIV>
<DIV>While both approaches have something going for them, they are not total
subside for each other.</DIV>
<DIV> </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial'; COLOR: #000000">With best
regards,<BR>Boian
Mitov<BR><BR>-------------------------------------------------------<BR>Mitov
Software<BR>www.mitov.com<BR>-------------------------------------------------------</DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=augustoktobar@gmail.com
href="mailto:augustoktobar@gmail.com">August Oktobar</A> </DIV>
<DIV><B>Sent:</B> Tuesday, September 23, 2014 10:35 AM</DIV>
<DIV><B>To:</B> <A title=fpc-devel@lists.freepascal.org
href="mailto:fpc-devel@lists.freepascal.org">FPC developers' list</A> </DIV>
<DIV><B>Subject:</B> Re: [fpc-devel] Suggestion: reference counted
objects</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV dir=ltr>To somebody (probably Sven):<BR><BR>In FPC there is concept of
stack based objects (object) <SPAN lang=en id=result_box><SPAN></SPAN><SPAN>that
behave like</SPAN> <SPAN>classes</SPAN> <SPAN>(</SPAN><SPAN>with</SPAN>
<SPAN>inheritance</SPAN><SPAN>)</SPAN><SPAN></SPAN></SPAN>?<SPAN lang=en
id=result_box><BR><SPAN>Why not</SPAN> just extend this object with support for
<SPAN>constructors and</SPAN> <SPAN>destructors</SPAN><SPAN>, and</SPAN>
<SPAN>there is no need</SPAN> <SPAN>for</SPAN> <SPAN>the
ARC</SPAN><SPAN>?</SPAN></SPAN><BR></DIV>
<DIV class=gmail_extra>
<DIV> </DIV>
<DIV class=gmail_quote>On Mon, Sep 22, 2014 at 2:05 PM, Hans-Peter Diettrich
<SPAN dir=ltr><<A href="mailto:DrDiettrich1@aol.com"
target=_blank>DrDiettrich1@aol.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Sven
Barth schrieb:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Am
22.09.2014 09:47 schrieb "Michael Schnell" <<A
href="mailto:mschnell@lumino.de" target=_blank>mschnell@lumino.de</A>
<BR></BLOCKQUOTE><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">>
Why not use "interface" to add ref-counting to an object ? This seems to
work nicely even though the name "interface" in not "speaking" on that
behalf.<BR><BR>Because you'll need to declare an interface for each class
you want to have reference counted so that you can access its methods,
properties, etc.<BR></BLOCKQUOTE><BR>This overhead could be eliminated by
another syntax extension, like<BR> TMyARCclass =
interface(TObject)<BR>where the Compiler could allow for implementations of
the declared methods just as for<BR> TMyARCclass =
class(TObject)<BR>bridging the gap between traditional (strictly declarative)
interfaces and classes (including implementations), with or without
ARC.<BR><BR>DoDi<BR><BR>______________________________<U></U>_________________<BR>fpc-devel
maillist - <A href="mailto:fpc-devel@lists.freepascal.org"
target=_blank>fpc-devel@lists.freepascal.org</A><BR><A
href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel"
target=_blank>http://lists.freepascal.org/<U></U>cgi-bin/mailman/listinfo/fpc-<U></U>devel</A><BR></BLOCKQUOTE></DIV>
<DIV> </DIV></DIV>
<P>
<HR>
_______________________________________________<BR>fpc-devel maillist
-
fpc-devel@lists.freepascal.org<BR>http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel<BR></DIV></DIV></DIV></BODY></HTML>