lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev outofmem() allocating memory


From: Klaus Weide
Subject: Re: lynx-dev outofmem() allocating memory
Date: Wed, 7 Apr 1999 10:25:32 -0500 (CDT)

On Wed, 7 Apr 1999, Leonid Pauzner wrote:

> 7-Apr-99 07:16 Klaus Weide wrote:
> 
> > Alternatively, outofmem() could try to do some of the cleanups that
> > free memory first, before doing anything else.  Then there should be
> > at least enough memory available for stdio purposes.  Too bad that
> > memory cleanup has just been disabled in recent patches!
> 
> Right. I think fprintf() message should be removed from outofmem()
> and FatalProblem(), LYexit() [else] reorganized a little:
> there is already a large chunk for LYOutOfMemory condition,
> so place all atexit staff and messages there to close cleanly.

A potential problem: if the message is not written immediately,
another problem can occur during the attempted cleanup, leading
to an abort.  In that case the original message would never be
seen, and the original cause of the error (whether outofmemory
or FatalProblem) would be totally obscure.

The situation where outofmem() has not enough memory to even print
an error message is so pathetic that there isn't much that can
be done safely.  Can't stop curses (it probably implies at least
a flush),  Can't do a lot of stuff since it may generate TRACE
messages.

> So we need two kind of atexit() calls - one for free_atexit()
> to do only when necessary and another for special actions
> like one pointed out by Doug recently.

We already have the two names needed, call either LYatexit() or
atexit(), define atexit(fcn) to be either 'LYatexit(fcn)' or '' (empty)
as required...

   Klaus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]