<HTML>
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>As mentioned before, the main problem with try...finally blocks is that they incur a massive speed penalty, so they're not things you want to enter and exit on a frequent basis. Whether that means we need to work on the compiler so it reduces this penalty on such blocks (such as internally removing the construct and copying the code in the 'finally' section into a local exception handler) I'm not sure.<br>
<br>
I do agree though that we should manage memory with care, especially as Pascal gives us such fine control over it (compared to, say, C++'s RAII feature which is a little nebulous at times with its garbage collection). I think first though we need to fix any obvious memory leaks, namely objects and blocks of memory that we forget to free, then build up from there. At least that will help reduce the risk of an out of memory situation during normal operation.<br>
<br>
Gareth aka. Kit<br>
<br>
<br>
<span style="font-weight: bold;">On Mon 30/07/18 21:27 , "Marcos Douglas B. Santos" md@delfire.net sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">On Mon, Jul 30, 2018 at 3:31 PM, R0b0t1 <<a href="mailto:r030t1@gmail.com">r030t1@gmail.com</a>> wrote:
<br>
<span style="color: rgb(102, 102, 102);">> On Mon, Jul 30, 2018 at 11:42 AM, Marcos Douglas B. Santos
</span><br>
<span style="color: rgb(102, 102, 102);">> <<a href="mailto:md@delfire.net">md@delfire.net</a>> wrote:
</span><br>
<span style="color: rgb(102, 102, 102);">>> On Mon, Jul 30, 2018 at 12:29 PM, R0b0t1 <<a href="mailto:r030t1@gmail.com">r030t1@gmail.com</a>> wrote:
</span><br>
<span style="color: rgb(102, 102, 102);">>>
</span><br>
<span style="color: rgb(102, 102, 102);">>> [...]
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> If a program isn't long running I see programmers tend to not care
</span><br>
<span style="color: rgb(102, 102, 102);">> about memory management, nor do I make a habit of caring about it
</span><br>
<span style="color: rgb(102, 102, 102);">> myself. I find it hard to see anything wrong with this.
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> As someone has mentioned this can fail on smaller computers, but how
</span><br>
<span style="color: rgb(102, 102, 102);">> much RAM is too little? SBCs now typically come with 1-4GB of memory.
</span><br>
<br>
I'm sorry, but we work with a language that expected programmers
<br>
should manage their objects.
<br>
The language even provides a clean way (try-finall) to do that.
<br>
I use try-finally even to write a snippet to show an example of code...
<br>
<br>
IMO, that must be a habit in such languages.
<br>
<br>
regards,
<br>
Marcos Douglas
<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>
<br>
</blockquote></HTML>