<font color='black' size='2' face='arial'><font size="2">@Nikolay<br>
Thank you for your answer. :) Now that you've answered, can you further respond to the following question: why is it needed to zero fill the memory allocated that exceeds the requested value?<br>
a) "pointer:=allocmem(initialsize); reallocmem(pointer,increasedsize);". I don't see the benefits of the zero filled bytes that exceed the "initialsize" value at "pointer". Once you "reallocmem" to increase size you don't expect to have the additional space filled with zeros. This means that an attempt to somehow optimize code because of initial more than enough zero filling is something hard to believe in.<br>
b) if your affirmation is right then for "</font><font size="2">bytepointer:=allocmem(sizeof(byte));" we would zero fill at least 3 or 7 times the necessary amount. At the moment I don't see nothing good at that. The closest thing that got into my mind was the arrays. For an unknown reason to me, yet(somebody please enlighten me) dynamic arrays are always zero filled. But even these arrays don't use allocmem. It was something that got me curious. Instead of allocmem, getmem&fillchar are used separately :) (see dynarr.inc fpc_dynarray_setlength). Somebody saw the bottleneck(waste, whatever you want to call it) with this allocmem situation.</font><br>
<font size="2"> So. Can you please further develop you answer according to this message.</font><br>
</font>