[Kst] memory checks...

Barth Netterfield netterfield at astro.utoronto.ca
Thu May 27 19:46:05 CEST 2004


or malloc/free for these.... minimum surprises... if a little um, uncool.

cbn

On May 26, 2004 01:27 pm, Andrew Walker wrote:
> At present kst is compiled with the -fno-check-new flag.
>
> If a memory allocation (new) fails due to lack of memory then
> the std::badalloc exception is thrown. As no exceptions are
> handled in Kst the program will crash in a most ungraceful
> manner.
>
> We could either catch these exceptions, or alternatively,
> could compile with the -fcheck-new flag. This flag will result
> in new not throwing an exception, but will instead return NULL
> for the allocated memory. Kst would then only need to check the
> returned pointer on each memory allocation.
>
> Yet another alternative would be to use new (nothrow). However,
> this was added only relatively recently to g++, so may not be
> available to many people.
>
> Performing these memory checks could allow us to survive in low
> memory conditions when we request a potentially very sizeable
> memory allocation for a new vector. If the allocation fails we
> would advise the user and Ksy would continue to run, whereas at
> present it will simply crash.
>
> Andrew
>
>
>
>
> ________________________________________________________________
> $0 Bannerless Web Hosting, 10 POP and Web Email Accounts, & more
> Get It Now At www.doteasy.com
>
>
>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst




More information about the Kst mailing list