[fpc-pascal] Feature announcement: Dynamic array extensions

Sven Barth pascaldragon at googlemail.com
Fri May 25 14:41:45 CEST 2018


Ryan Joseph <ryan at thealchemistguild.com> schrieb am Fr., 25. Mai 2018,
12:45:

>
>
> > On May 25, 2018, at 3:57 PM, Sven Barth via fpc-pascal <
> fpc-pascal at lists.freepascal.org> wrote:
> >
> > If I had to guess you were probably doing something with the arrays they
> weren't designed for. :/
> >
>
> It’s a little foggy now but I think I had a dynamic array in a class which
> was being passed around some functions or the class (with the dynamic
> array) was in a record which was being passed around some functions. I
> think this was happening within tight loops also.
>
> Bottom line is if the that thread lock function does anything expensive
> then passing around dynamic arrays within tight loops could be a deal
> breaker unless you could manually declare a dynamic array as not thread
> safe.
>

When passing around dynamic arrays in such situations var and constref
parameters should be used and assignments inside those loops should be
avoided.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180525/e6bc2c1b/attachment.html>


More information about the fpc-pascal mailing list