On Tue, 29 Apr 2014 12:13:48 +0200
Petr Kristan <petr.kris...@epos.cz> wrote:

>[...]
> Is possible to tune this space behind the blocks?

The space is bad for the processor's caches.
You only need the space behind when you want to grow big chunks in
many small steps. Since this does not happen often it is
better to change the few places in your code than the whole heap
manager.

Just allocate somewhat more than you need.
For example:

if NeededSize>CurrentSize then
begin
  CurrentSize:=Max(NeededSize,CurrentSize+CurrentSize div 2);
  ReAllocMem(p1, CurrentSize);
end;


Mattias
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to