Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-12-22 23:03:19


>> If I'm correct, this could be easily fixed by changing all occurences of
>> "p =
>> std::malloc(n)" to "p = std::malloc(n ? n : 1)" or something similar.
>
> Ok. Applied.
>
>Shouldn't it be applied only if std::malloc returns NULL on 0-sized
>allocations? A std::malloc implementation that returns unique pointers for
>zero sizes is OK. Maybe something like:
>
> void * p = std::malloc( n );
> if ( !n && !p ) p = std::malloc( 1 );
> return p;
>
>would be better?

Does it matter? I do not want to complicate things too much.

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk