[fpc-devel] Pre-zeroing in MM by background thread/process

Florian Klaempfl florian at freepascal.org
Wed Oct 6 09:26:31 CEST 2010


Am 06.10.2010 05:57, schrieb Adem:
>  I did a global search on trunk\compiler and found the following numbers:
> 
> GetMem(): 212 hits
> FillChar(): 362 hits
> 
> I haven't checked any other fpc folder, but I am sure those figures
> would multiply.
> 
> What I did notice was that GetMem() and FillChar() were being used in
> pairs most of the time --as opposed to using AllocMem() which had  16 hits.
> 
> My focus isn't on the merits of using AllocMem() instead of GetMem() and
> FillChar() pair; what I do notice is the fact that in a lot of places
> there is a strong need for zeroed memory.
> 
> That brings me to the idea of handling the zeroing of memory chunks by
> the memory manager (MM) instead of doing it in-line.

A similiar idea has been discussed already here:
<http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg17846.html>

Besides this, it is pretty simple: give it a try and provide a patch.



More information about the fpc-devel mailing list