From: Stephen M. W. <ste...@cr...> - 2002-06-25 12:48:11
|
On June 25, 2002 07:55 am, Thomas Pfaff wrote: > > I had no problems with gcc 2.95.3 to define __USE_MALLOC. Couldn't > see any memory leaks. I have attached my Makefile. The default allocator in 2.95 was the malloc_alloc allocator. The default 3.1 allocator is a more sophisticated beast that conforms to the standard (ie. uses 'new' to allocate memory) and has mutex guards against concurrent access. If you build your application using 2.95 and __USE_MALLOC, great, everything matches. If you build with the default 3.1 and define __USE_MALLOC in your code, you will likely run into trouble since your code doesn't match what's in the library. The __USE_MALLOC option is a library build-time option, not a user compile-time option. See http://gcc.gnu.org/onlinedocs/libstdc++/23_containers/howto.html#3 for more. -- Stephen M. Webb |