Welcome, Guest. Please login or register.

Author Topic: Dealing with critical out of memory situations, interaction with auto stack enlargement app ?  (Read 1167 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
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:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2280
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
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.
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
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 ?
\\"We made Amiga, they {bleep}ed it up\\"