[fpc-pascal] memory allocation of dynamic array
M.Santhoff at t-online.de
Sun Sep 23 05:18:12 CEST 2007
a while ago I asked if I can assume the memory held by dynamic arrays is
allocated in one contiguous block.
The answer was sth. like "No, never!".
I wrote a small testing programm using SetLenght() on an array multiple
times using a bigger size every time and comparing the addresses of the
I wasn't able to provoke getting something else than sizeof(integer),
which is the base type of that array.
In which cases will it happen that the memory of a dynamic array is
fragmented into multiple non-contiguous blocks?
More information about the fpc-pascal