[fpc-pascal] Array clearing

Ryan Joseph ryan at thealchemistguild.com
Thu Apr 13 17:35:23 CEST 2017

> On Apr 13, 2017, at 10:29 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> SetLength *does* use a reallocate for this, but since it doesn't give you any guarantee for its success as its the task of the memory manager to deal with this, it's easier to assume that the array is indeed copied.

So the real point here is that ReAllocMem will copy and allocate a new block if the old one can’t be resized, therefore this really isn’t about SetLength as much as the memory manager itself.

	Ryan Joseph

More information about the fpc-pascal mailing list