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

List:       kde-devel
Subject:    Re: C++ exceptions
From:       Thiago Macieira <thiago () kde ! org>
Date:       2005-12-07 13:36:54
Message-ID: 200512071136.55146.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Lubos Lunak wrote:
>> True. And I think all those "new" that allocate memory that is
>> potentially large should either be in a try/catch block or use
>> new(nothrow) so as to catch bad allocations. One such case is
>> demarshalling a QDataStream.
>
> That still may not actually help that much with memory overcommitting.

That's a different problem.

Memory overcommitting means the memory requested to be allocated was of a 
reasonable size. And when you run out of memory after overcommitting, the 
application gets a SIGBUS that's really difficult to understand.

What I am suggesting is getting rid of unreasonable memory allocations. 
There are many cases of backtraces in bugs.kde.org of applications 
crashing after std::bad_alloc was thrown from the inside of 
QString::setLength.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

2. Tó cennan his weorc gearu, ymbe se circolwyrde, wearð se cægbord and se 
leohtspeccabord, and þa mýs cómon lator. On þone dæg, he hine reste.

[Attachment #5 (application/pgp-signature)]

>> 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