Re: [Stlport-devel] vector's insert/resize not throwing?
Brought to you by:
complement
From: François D. <fra...@fr...> - 2008-06-04 20:25:30
|
I should have signal you this macro I had added it a long time ago for VC6 that have the same problem, will be in 5.2. AFAIR Win CE had not exception support, it is not true anymore for modern Win CE compilers ? While applying it I also check situation regarding management of memory and discovered an other problem. When _STLP_RTTI_BUG is defined __stl_new is implemented based on malloc without check for allocation failure. The good news is that _STLP_RTTI_BUG is never defined in any config file, AFAIR this macro has been introduced for Win CE, can it be remove ? Bests Ulrich Eckhardt wrote: > On Tuesday 27 May 2008, Ulrich Eckhardt wrote: > >> I'm currently stumbling across the problem that a vector is being resized >> but instead of the allocator throwing, it simply returns null. The calling >> code assumes that the returned pointer is non-null and happily starts >> writing to an invalid memory location. >> > > I have another patch which I'd like to propose for inclusion in > stl/config/_msvc.h: > > #if defined(UNDER_CE) > /* All eVCs up to at least VC8/CE5 have a broken new operator that > returns null instead of throwing bad_alloc. */ > # define _STLP_NEW_DONT_THROW_BAD_ALLOC 1 > #endif > > AFAICT, this is the main reason why STLport's workaround for broken new > implementations doesn't work under CE, it is simply not used. This change > requires both a recompile of STLport and client code using it, so I guess > it's for 5.2 only. > > Uli > > |