segfault with std::allocator

Toon Knapen toon.knapen@fft.be
Fri Sep 3 13:23:00 GMT 2004


Following problem segfaults with gcc 3.2.2 inside the deallocate 
function. AFAICT however, allocation and deallocation of 0 number of 
objects are allowed ?

<code>
<code>
#include <memory>

int main()
{
    std::allocator< int > int_alloc ;
    int* p = int_alloc.allocate( 0 ) ;
    int_alloc.deallocate( p, 0 ) ;
    return 0 ;
}
</code>





More information about the Gcc-help mailing list