내 코드에서 mem leak를 제어하려고합니다. 이 코드를 추가하는 경우"new"를 덮어 쓸 때 컴파일 오류가 발생합니다.
// You may need to locate mem leaks
#define ZEL_CHECK_MEMORY_LEAKS
#ifdef ZEL_CHECK_MEMORY_LEAKS
#define _CRTDBG_MAP_ALLOC
#include <cstdlib>
#include <crtdbg.h>
#ifdef _DEBUG
#ifndef DBG_NEW
#define DBG_NEW new (_NORMAL_BLOCK , __FILE__ , __LINE__)
#define new DBG_NEW
#endif
#endif // _DEBUG
#define zelInitMemoryCheck() \
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF)
#else
#define zelInitMemoryCheck()
#endif //ZEL_CHECK_MEMORY_LEAKS
, 나는이 컴파일 오류 얻을 : 내 일반 헤더 파일에이 코드 추가 한 또한
1>c:\archivos de programa\microsoft visual studio 9.0\vc\include\xlocmon(283) : error C2061: syntax error : identifier '_DebugHeapTag_func'
1> c:\archivos de programa\microsoft visual studio 9.0\vc\include\xlocmon(281) : while compiling class template member function 'size_t std::moneypunct<_Elem,_Intl>::_Getcat(const std::locale::facet **,const std::locale *)'
1> with
1> [
1> _Elem=char,
1> _Intl=true
1> ]
1> c:\archivos de programa\microsoft visual studio 9.0\vc\include\xlocmon(908) : see reference to class template instantiation 'std::moneypunct<_Elem,_Intl>' being compiled
1> with
1> [
1> _Elem=char,
1> _Intl=true
1> ]
을 내 소스 코드에서 나는이 포함이 : MEM은 제어 코드를 유출
#include "core/zelCoreLib.h"
#include <boost/shared_ptr.hpp>
이는 VC9.0이없는 사람으로 zelCoreLib.h
에있다
static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet **_Ppf = 0,
const locale *_Ploc = 0)
{ // return locale category mask and construct standard facet
if (_Ppf != 0 && *_Ppf == 0)
*_Ppf = _NEW_CRT moneypunct<_Elem, _Intl>(
_Locinfo(_Ploc->name()), 0, true);
return (_X_MONETARY);
}
문자열과 로케일 기능의 일부인 것처럼 보입니다. 또한, 추가 정보로, 나는 루아와 LuaBind libs와
어떤 도움 당신은 #define new
이
[vld] (http://sites.google.com/site/dmoulding/vld)와 같은 기존 도구를 사용하지 않는 이유는 무엇입니까? –
계속하려면 여기에 절대적으로 충분하지 않습니다. _complete_, 최소한의 테스트 케이스를 만드십시오. –
몇 가지 최소한의 예를 들었고 모두 괜찮 았습니다. 그리고이 시점에서 나는이 오류가 있습니다. 내 로그 라이브러리를 모두 삽입 할 수는 있지만 과도 할 수도 있습니다. – Killrazor