<HTML>
Apologies if these things seem trivial. I probably need to read the documentation cover to cover to learn about these global state variables.<br>
<div><br>
</div><div>I am a bit surprised that hitting out of memory exceptions causes incorrect error messages to appear though.<br>
</div><div><br>
</div><div>Gareth aka. Kit<br>
</div> <br>
<br>
<span style="font-weight: bold;">On Mon 30/07/18 22:10 , Sven Barth via fpc-devel fpc-devel@lists.freepascal.org sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT:0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<defanged_meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<defanged_body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 30.07.2018 um 19:49 schrieb J.
Gareth Moreton:<br>
</div>
<blockquote type="cite" cite="mid:10838.1532972966@web-cluster.fastnet.co.uk">
<defanged_meta http-equiv="content-type" content="text/html; charset=utf-8">
<div>
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!</div>
</defanged_meta></blockquote>
The default heap of FPC's RTL respects the value of
ReturnNilIfGrowHeapFails (which by default is False).<br>
<br>
Regards,<br>
Sven<br>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>
<a target="_blank" href="<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>"><span style="color: red;">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</span></a><br>
<br>
</defanged_body></defanged_meta></blockquote></HTML>