valgrind confused by std::allocator calls to operator new(0)

Nathan Myers ncm-nospam@cantrip.org
Tue Feb 22 16:49:00 GMT 2005


On Tue, Feb 22, 2005 at 03:30:46PM +0100, Paolo Carlini wrote:
> >This may be out of context...  The standard defines that allocators
> >(and operator new) may be asked for zero bytes. 
> 
> I'm pretty sure we already briefly discussed this corner case. I think the
> behavior of 3.3 (returning *always* zero in this case), is perfectly ok,
> because of this note in Table 32, about allocate:
> 
>    "Note: If n == 0, the return value is unspecified."

You can't turn your back on those people for a second.

Nathan Myers
ncm@cantrip.org



More information about the Libstdc++ mailing list