Welcome, Guest. Please login or register.

Author Topic: Saving to HD with almost zero free memory possible ?  (Read 2136 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Saving to HD with almost zero free memory possible ?
« on: February 02, 2006, 06:34:52 PM »
Hi. Is there a way to save data to HD or send it over a network when there is an out of memory error or there's no way around it ? The goal is to be able to save a log of errors that happened during program execution but if the error is out of memory and memory is close to zero (maybe not even enouph for a file handle ?)I guess there's not much you can do.
My own solution would be to have a contantly open file to save to, so that the system doesn't have to allocate memory for the file lock.
Any other suggestions on how to handle this...?

:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Saving to HD with almost zero free memory possible ?
« Reply #1 on: February 02, 2006, 08:14:39 PM »
That's great (reserving a big enouph chunk for my program when it launches) but the problem is that it allocates memory dynamically. Sometimes it needs more, sometimes less, so I'd have to write my own "internal allocator". Never tried it, myabe it's not that difficult.. (another bunch of time with something not predicted...:getmad:))

For the error log I think I'm just gona leave a file constatly open and just try to save an error code.  

:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Saving to HD with almost zero free memory possible ?
« Reply #2 on: February 02, 2006, 09:14:32 PM »
@Doobrey

Heck, I didn't knew that existed. Rules! I'll check it out as soon as I get home. :pint:
\\"We made Amiga, they {bleep}ed it up\\"