[Info-vax] BASIC (and Horizon)

Arne Vajhøj arne at vajhoej.dk
Thu Feb 1 21:29:57 EST 2024


On 2/1/2024 8:44 PM, Scott Dorsey wrote:
> =?UTF-8?Q?Arne_Vajh=C3=B8j?=  <arne at vajhoej.dk> wrote:
>> On 1/31/2024 11:17 AM, Scott Dorsey wrote:
>>> Michael S  <already5chosen at yahoo.com> wrote:
>>>> The third option, the one I like least (an understatement) is use of
>>>> exceptions. Despite my personal preferences, it's quite popular.
>>>
>>> Exceptions can be very elegant or very inelegant... and it is entirely
>>> possible to have an exception that doesn't clean anything up at all and
>>> just exits and lets the operating system deal with the memory.  On many
>>> systems this is a great idea because being able to exit quickly on a failure
>>> is more important than people give it credit for.  On some other systems
>>> that have memory management issues it can lead to leakage.
>>
>> It is probably a bit easier to implement exceptions in languages
>> with garbage collection and a lot easier for developers to avoid
>> memory leak bugs.
> 
> True, but "dispose of all memory belonging to this process" should not be
> a big deal on a demand-paged machine.  There are some architectures where
> it can be, though.

The issue is not if the process goes away but if the process
continue after execution flow has dropped back a number of levels
on the call stack.

The C++ code I posted did exit, but main could have called
f1 again after catching the exception. Maybe doing it
a billion times leaking one object for every call.

Arne





More information about the Info-vax mailing list