[fpc-pascal] Feature announcement: Dynamic array extensions

Michael Van Canneyt michael at freepascal.org
Fri May 25 10:18:21 CEST 2018



On Fri, 25 May 2018, Ryan Joseph wrote:

>
>
>> On May 25, 2018, at 1:06 PM, Michael Van Canneyt <michael at 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.


More information about the fpc-pascal mailing list