[fpc-devel] Why/how does the compiler have a non-trivial numberofmemory leaks after over two decades of development?
J. Gareth Moreton
gareth at moreton-family.com
Mon Jul 30 16:38:48 CEST 2018
Not necessarily. The Internal Errors are effectively assertions that
should never be triggered. True, cleaning up the memory is a bonus, but
here it's safe to assume that the internal state of the compiler is bad in
some way. Throwing an exception upon too many errors might be problematic
because there's no telling where it might trigger, but otherwise, the
compiler abort tends to occur after it's finished attempting to compile its
current node trees, so most memory should be freed. Still, it's something
one might want to research to see if the exception handler can check and
free some global structures.
Gareth aka. Kit
On Mon 30/07/18 16:24 , "Michael Van Canneyt" michael at freepascal.org sent:
On Mon, 30 Jul 2018, Sven Barth via fpc-devel wrote:
> Michael Van Canneyt schrieb am Mo., 30. Juli 2018,
> 15:30:
>
>> Obviously provided you don't install another mechanism that does this
and
>> don't raise exceptions manually, which - AFAIK - is the case in the
>> compiler...
>>
>
> The compiler does use exceptions when the compilation needs to be
aborted
> e.g. when too many errors occurred or an internal error is encountered.
This is bad news, because it in effect means that the try/finally is
necessary
if people want to fix memleaks :(
This will considerably slow down the compiler.
Michael.
_______________________________________________
fpc-devel maillist - fpc-devel at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[1]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Links:
------
[1] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180730/71c74598/attachment.html>
More information about the fpc-devel
mailing list