[fpc-pascal] Array clearing

Ryan Joseph ryan at thealchemistguild.com
Sun Apr 2 11:22:00 CEST 2017


> On Apr 1, 2017, at 9:25 PM, Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:
> 
> If you just need to reuse the same array and only need to zero its elements
> then of course fillchar would be the fastest approach (it saves the memory
> reallocation step).

Why is this “of course”? What’s the implementation of FillChar exactly? For all I know it has to iterate over a range of bytes and this could be slower than allocation of memory. Maybe some of the compiler people know these details.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list