[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Exceptions, libraries, gcc and new
From:       Kuba Ober <kuba () mareimbrium ! org>
Date:       2002-11-01 13:38:56
[Download RAW message or body]

On środa 30 październik 2002 09:12 am, Stephan Kulow wrote:
> Am Wednesday 30 October 2002 14:39 schrieb Kuba Ober:
> > [...]
> >
> > > > Yes, you're right. I take it, gcc links-in a lib that provides
> > > > operator new and chooses a different lib depending on whether
> > > > exceptions are enabled.
> > > >
> > > > So, does this in effect mean that one can't *safely* use exceptions
> > > > in a KDE program because then new might fail within Qt or KDE code
> > > > in ways that aren't expected there? My understanding is that the
> > > > only C++ standards-conforming solution would be to replace 'new'
> > > > with 'new(nothrow)' throughout Qt and KDE.
> >
> > That's a beautiful technical discussion and all, but, tell you what:
> > completely pointless. If operator new fails your system is probably in a
> > nearly-doomed state... It means that virtual memory has been exhausted,
> > and most apps are *not* designed to handle that case well, if at all.
> > And, usually, before the VM is exhausted, the swapping slows everything
> > to a crawl anyway... Most people reboot before any operator new has a
> > chance to fail ;-)
>
> You're missing the case of ulimit -v

In which case if it's being hit, it means it's set too low ;-))))

Now, realistically: most complex gui apps have no implemented clean ways to 
wind down themselves if they hit memory limit. That's the architectural 
problem, but people would rather have stuff working than fiddling with border 
cases, and I sorta-kinda understand that. Programmers are lazy creatures (my 
programmer self is, at least ;-))

Cheers, Kuba Ober
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic