Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Jose on March 07, 2006, 11:27:30 PM
-
Hi. Most normall programs would probably display a message saying out of memory, sorry dude can't continue, but...
In what I'm trying to do I want the program to be able to have some memory reserves, wich actually is already done. However there still is is a remote possibility of an out of memory not due to a failed allocation with AllocMem/AllocVec but due to excessive recursion. Most likely, this would be an extreme and rare situation and I even have some code there to avoid it somehow (the user can define a maximum amount of recursion for some routines) this is still not perfect so I want to know:
Is it possible for my code to interact with automatic stack enlargement patches available for 3.x or the OS code itself on AOS4/MOS so that it knows when the limit is reached ? Or it's just prone to crash in that situation ?
:pint:
-
Of the languages I know that allocate their own stacks (namely AmosPro and AmigaE) each limits the recursion of all procedure calls and probably regulate them with an unnamed global variable to keep track of how many calls are nested.
Stack enlargement utilities are still a kludge not supported directly by any version of the AmigaOS and I think you stumbled onto one reason why.
-
I'll just stick with the code I have then.. It's already out of "normall" apps to have limitation on recursion I guess so it's not that bad.
How do Windows and Mac platforms handler this BTW ?