[fpc-pascal] Effective memory allocation

Sven Barth pascaldragon at googlemail.com
Mon Nov 3 12:04:16 CET 2014


Am 03.11.2014 08:32 schrieb "Nico Erfurth" <ne at erfurth.eu>:
>
> On 02.11.14 15:05, Xiangrong Fang wrote:
> > Sorry, the results in previous mail was mis-labeled.
> >
> > ​
> > The result is:
> >
> > Using SetLength:
> >
> > Alloc:  9.4078169999999997E-0001
> > Clear:  2.1342020000000002E-0001
> >
> > Using GetMemory:
> >
> > Alloc:  2.8100000000000000E-0005
> > Clear:  7.7497550000000004E-0001
>
>
> SetLength will already clear the array before returning it, so the time
> for SetLength is approximate time(GetMem) + time(Clear).

Ah, right. I forgot that :)

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20141103/fd897fec/attachment.html>


More information about the fpc-pascal mailing list