On Fri, 25 May 2018, Ryan Joseph wrote:



On May 25, 2018, at 1:06 PM, Michael Van Canneyt <mich...@freepascal.org> wrote:

Dynamic arrays are reference counted. The interlocked increment is there to
make the operations thread safe. I do not know whether the classes you speak
of are thread safe. If there is no FPC_INTERLOCKEDINCREMENT64, most likely
they are not.

Dynamic arrays have their reason for existence. For one thing, they are a 
continuous block
in memory, properly aligned and whatnot. The collection classes make no such
guarantees.

I made my own class because I wanted to guarantee nothing silly was going on 
behind the scenes. I didn’t need thread safe so opting out of all the extra 
work done to make them safe is important sometimes. That would be nice if you 
could do the same with dynamic arrays honestly.

I'm guessing you are not using strings either then, for performance reasons ? Because exactly the same happens there.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to