Discussion:
Why/how does the compiler have anon-trivialnumberofmemory leaks after over two decades of development?
(too old to reply)
J. Gareth Moreton
2018-07-30 20:19:57 UTC
Permalink
Raw Message
Apologies if these things seem trivial. I probably need to read the
documentation cover to cover to learn about these global state variables.

I am a bit surprised that hitting out of memory exceptions causes
incorrect error messages to appear though.

Gareth aka. Kit

On Mon 30/07/18 22:10 , Sven Barth via fpc-devel
fpc-***@lists.freepascal.org sent:
Am 30.07.2018 um 19:49 schrieb J. Gareth Moreton:
The trouble is, these allocation failures are designed for C programs,
where "malloc" returns NULL if memory isn't allocated.  Free Pascal's
GetMem raises an exception instead.  Granted, it shouldn't be too much of
a struggle to implement a custom memory manager for testing and to cause
random (or deterministic) allocation failures to see how cleanly the
situation is handled.  It could be a fun test suite! The default heap of
FPC's RTL respects the value of ReturnNilIfGrowHeapFails (which by default
is False).

Regards,
Sven
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org [1]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[2]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



Links:
------
[1] mailto:fpc-***@lists.freepascal.org
[2] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Sven Barth via fpc-devel
2018-07-31 05:10:50 UTC
Permalink
Raw Message
J. Gareth Moreton <***@moreton-family.com> schrieb am Mo., 30. Juli
2018, 23:20:

> Apologies if these things seem trivial. I probably need to read the
> documentation cover to cover to learn about these global state variables.
>
> I am a bit surprised that hitting out of memory exceptions causes
> incorrect error messages to appear though.
>

Well, going out of memory is a bit of a nasty situation and normally not
really checked for anyway.

Regards,
Sven

>
Loading...