std::map allocations questions

Jonathan Wakely jwakely.gcc@gmail.com
Tue Dec 7 23:22:00 GMT 2010


On 7 December 2010 23:07,  <dagecko@free.fr> wrote:
>
> Hi,
>
> sorry to bother you here,
>
> I wanted to create a memory checker for my programs. I tried to used
> std::map for this.
> So I do something like this (I don't like to send code like this, the
> first time, but I hope this would help...)

The gcc-help mailing list is more appropriate for this question.  This
list is for development of libstdc++, not help about using it.

>
> With the appropriate overloading of new function.

I can only guess what you consider "appropriate" but obviously
std::map allocates memory internally, so if you have replaced the
global new operator, then it will get called recursively.

This is not a problem with std::map, it's just unavoidable that a
container using dynamically-allocated memory will have to allocate
memory!



More information about the Libstdc++ mailing list