Re: xmalloc string functions



On Jan 29, 6:29 pm, Flash Gordon <s...@xxxxxxxxxxxxxxxxxx> wrote:
ymunt...@xxxxxxxxx wrote, On 29/01/08 22:56:



On Jan 29, 2:06 pm, Flash Gordon <s...@xxxxxxxxxxxxxxxxxx> wrote:
Malcolm McLean wrote, On 29/01/08 10:06:

"Flash Gordon" <s...@xxxxxxxxxxxxxxxxxx> wrote in message
Not always. I've done it using structured programming in assembler
without implementing exceptions and at each point I checked the status
and propagated the error until it could be handled. The handling
consisted of processing what it had memory for giving degraded
performance instead of giving up which would not have been acceptable.
It was also easy to do because I new resources were limited and
designed the SW assuming that they could run out.
I've done this as well. It was adding so much complexity to code, all
because of allocation failures that couldn't happen.
It did not cause me significant extra work. The most likely reason for
the difference is that I designed the entire system knowing that
out-of-resource errors *do* occur so it was part of the entire design
concept rather than an extra I had to try and fit in.

This is a very good point. In those stupid GUI applications
out-of-memory errors occur less often than crashes caused
by usual bugs.

Maybe for you. I, on the other hand, can be running three VMs eating up
a bit over three quarters of the memory, Lotus Notes, another email
client (yes, I have good reasons for using multiple email clients
simultaneously) and several other applications.

In that update-mime-database application
memory errors never occur in observable practice.

I'm frequently tight on memory, so...

For
many applications, out-of-memory error is a disaster
(not for Lotus, I admit). Yet they do work.

Not for me they don't, if I find any application aborting simply due to
lack of memory it will be replaced. It will also be replaced (apart from
testing purposes if a customer uses it) if it crashes regularly for any
other reasons.



Oh, and my real-time applications degraded gracefully rather than
failing on out-of-time errors as well. Again it was a case of
considering how to do the job properly during the design of the
application not during coding.

Finally, within
BabyX (my X windows toolkit) there was no way I could think of of
propagating the error conditions back to the caller. Flow control is
just too complex with the whole thign beign held together by a newtwork
of function pointers. So I decided BabyX would use xmalloc().
Well, I would not have used your BabyX library anyway, but now I have
even more reason to avoid it.

I have no idea what BabyX does, and I have no idea how good it is,
but if the only bad thing about it is xmalloc(), then it's better
than both qt and gtk.

It also sounds like a mess based on the descriptions so far given.

So, you have a reason to avoid QT, Gtk, Python, shell. Are you
using any unix? Just curious.

I use AIX, Linux and several versions of Windows. I used to use SCO but
managed to get that dropped. I do C, the odd bits of Java and Perl,
XSLT, shell scripting, odd bits of SQL, some DBA work, systems
administration...

Then there are all the languages and systems I no longer use for various
reasons.

Um, I need to tell Kelsey about QT, it must make him swith
to windows immediately.

If QT does the same as glib then I'm sure people will say that is
braindead as well.

It doesn't do the same as glib. But it doesn't guard
event processing against oom exceptions either. Which
in effect means abort (again, you can catch the exception,
save data, and quit nicely, as you can do with glib; just
can't continue working as if nothing happened). Since
"ALL malloc calls are checked!"

I might switch back to one of the lighter weight GUIs
on my personal notebook anyway.

Don't forget to check their code. Oh, and while you're at
it, don't use X. It aborts on oom.

Yevgen
.



Relevant Pages

  • Re: xmalloc string functions
    ... I, on the other hand, can be running three VMs eating up a bit over three quarters of the memory, Lotus Notes, another email client (yes, I have good reasons for using multiple email clients simultaneously) and several other applications. ... propagating the error conditions back to the caller. ... Linux and several versions of Windows. ...
    (comp.lang.c)
  • Re: Address Verification
    ... called correctly is only w/in the memory manager itself. ... not loaded in RAM (i.e P bit of its corresponding entry in the page ... MmIsAddressValid() returns FALSE straight away. ... but this throws exceptions on ...
    (microsoft.public.development.device.drivers)
  • Re: Address Verification
    ... i discussed this w/the owner of the memory manager. ... not loaded in RAM (i.e P bit of its corresponding entry in the page ... MmIsAddressValid() returns FALSE straight away. ... but this throws exceptions on ...
    (microsoft.public.development.device.drivers)
  • Re: Handling Out Of Memory
    ... > will keep working if virtual memory is enabled and disk is full. ... > windows crash and burn: turn off virtual memory, ... fucking exceptions. ...
    (alt.comp.lang.borland-delphi)
  • Re: A solution for the allocation failures problem
    ... It is not possible to check EVERY malloc result within complex software. ... possible for software quality reasons. ... a memory exhaustion situation arises, ... you provoke allocation failures that don't need to happen. ...
    (comp.lang.c)