[fpc-pascal] Access violation in an empty project declaring heaptrc

Sven Barth pascaldragon at googlemail.com
Thu Mar 3 08:05:23 CET 2016


Am 03.03.2016 03:07 schrieb "silvioprog" <silvioprog at gmail.com>:
> Now, if you compile and run this project below with -gh:
>
> program project1;
>
> {$mode objfpc}{$H+}
>
> begin
> end.
>
> You will get:
>
> Heap dump by heaptrc unit
> 47 memory blocks allocated : 1173/1280
> 47 memory blocks freed     : 1173/1280
> 0 unfreed memory blocks : 0
> True heap size : 163840 (112 used in System startup)
> True free heap : 163728
>
> What means "112 used in System startup"? I have a project that in some
cases I get:
>
> Heap dump by heaptrc unit
> 90 memory blocks allocated : 2827/3072
> 90 memory blocks freed     : 2827/3072
> 0 unfreed memory blocks : 0
> True heap size : 196608
> True free heap : 196480
> Should be : 196608
>
> So it seems that the "Should be : 196608" in this case is related to the
128 used in the system startup, because when I comment all the code in this
project I get "128 used in System startup".

That is the memory that had been used before the memory manager of the
heaptrc unit had been setup. Remember that there's first the System unit
initialization and only then the initialization of the heaptrc unit.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160303/ca414c63/attachment.html>


More information about the fpc-pascal mailing list