//不可以使用於多執行序
//在多執行續內使用會造成不可預期的當機

#pragma once
#pragma warning (disable:4200)
#pragma warning (disable:4949)
#pragma unmanaged

#ifndef _MY_MEM_NEW_
#define NEW(x) new x
#define MyAllocMemoryReport( )
#define MyAllocRelease( )    
#define MyAllocMemoryCheck( )    
#else

#define NEW(x) __MyNew__( __FILE__ , __LINE__  , new x )
#define MyAllocMemoryReport _MyAllocMemoryReport
#define MyAllocRelease _MyAllocRelease    
#define MyAllocMemoryCheck _MyAllocMemoryCheck    



template <class T>
T* __MyNew__( char* File , int Line , T* Ret )
{
    _MyAllocReg( File , Line , Ret );
    return   Ret;
};

bool    _MyAllocReg( char* File , int Line , void* Point );

void    _MyAllocMemoryCheck( );
//列印記憶體
bool    _MyAllocMemoryReport( );
//清除記憶體
void    _MyAllocRelease( );        

void*	operator new[](size_t sz);
void*   operator new( size_t size );
void    operator delete( void *buf );
void    operator delete[]( void *buf );

#endif

#pragma managed


