void Insert(const void* p,const size_t sz,const char* msg,const char* file,const int line) { if (m_mem.find(p)!=m_mem.end()) ERROR("pointer already in debug memory map"); m_mem[p]=make_pair(sz,string(file) + ":" + tostring(line) + ": " + string(msg)); m_accumulated += sz; ++m_calls; }
void Remove(const void* p) { t_map::iterator itt=m_mem.find(p); if (itt==m_mem.end()) ERROR("pointer not found in debug memory map"); m_mem.erase(itt); }