diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2009-01-18 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2009-01-18 08:01:00 -0800 |
commit | f936cc0680c98ffe51b3a1716c996072d5dbf76c (patch) | |
tree | 784a2a809fb6b972ec6a8e2758ab758ca590d01a /src/misc/extra | |
parent | c9ad5880cc61787dec6d018111b63023407ce0e6 (diff) | |
download | abc-f936cc0680c98ffe51b3a1716c996072d5dbf76c.tar.gz abc-f936cc0680c98ffe51b3a1716c996072d5dbf76c.tar.bz2 abc-f936cc0680c98ffe51b3a1716c996072d5dbf76c.zip |
Version abc90118
Diffstat (limited to 'src/misc/extra')
-rw-r--r-- | src/misc/extra/extra.h | 21 | ||||
-rw-r--r-- | src/misc/extra/extraUtilMemory.c | 4 | ||||
-rw-r--r-- | src/misc/extra/extraUtilUtil.c | 16 |
3 files changed, 28 insertions, 13 deletions
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h index beb5a4d0..d7a3e98c 100644 --- a/src/misc/extra/extra.h +++ b/src/misc/extra/extra.h @@ -41,12 +41,6 @@ extern "C" { /* Nested includes */ /*---------------------------------------------------------------------------*/ -// this include should be the first one in the list -// it is used to catch memory leaks on Windows -#if defined(_DEBUG) && defined(_MSC_VER) && (_MSC_VER <= 1200) // 1200 = MSVC 6.0 -#include "leaks.h" -#endif - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -56,6 +50,12 @@ extern "C" { #include "cuddInt.h" #include "port_type.h" +// catch memory leaks in Visual Studio +#ifdef _DEBUG +#define _CRTDBG_MAP_ALLOC +#include <crtdbg.h> +#endif + /*---------------------------------------------------------------------------*/ /* Constant declarations */ /*---------------------------------------------------------------------------*/ @@ -77,17 +77,16 @@ extern "C" { /*---------------------------------------------------------------------------*/ #ifdef WIN32 -#define DLLEXPORT __declspec(dllexport) -#define DLLIMPORT __declspec(dllimport) +#define ABC_DLLEXPORT __declspec(dllexport) +#define ABC_DLLIMPORT __declspec(dllimport) #else /* defined(WIN32) */ -#define DLLIMPORT +#define ABC_DLLIMPORT #endif /* defined(WIN32) */ #ifndef ABC_DLL -#define ABC_DLL DLLIMPORT +#define ABC_DLL ABC_DLLIMPORT #endif - typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned int uint32; diff --git a/src/misc/extra/extraUtilMemory.c b/src/misc/extra/extraUtilMemory.c index 39c34296..e672afbb 100644 --- a/src/misc/extra/extraUtilMemory.c +++ b/src/misc/extra/extraUtilMemory.c @@ -339,7 +339,7 @@ int Extra_MmFixedReadMaxEntriesUsed( Extra_MmFixed_t * p ) ***********************************************************************/ Extra_MmFlex_t * Extra_MmFlexStart() -{ +{ Extra_MmFlex_t * p; //printf( "allocing flex\n" ); p = ALLOC( Extra_MmFlex_t, 1 ); @@ -349,7 +349,7 @@ Extra_MmFlex_t * Extra_MmFlexStart() p->pCurrent = NULL; p->pEnd = NULL; - p->nChunkSize = (1 << 10); + p->nChunkSize = (1 << 12); p->nChunksAlloc = 64; p->nChunks = 0; p->pChunks = ALLOC( char *, p->nChunksAlloc ); diff --git a/src/misc/extra/extraUtilUtil.c b/src/misc/extra/extraUtilUtil.c index abe08d7a..7165a0cd 100644 --- a/src/misc/extra/extraUtilUtil.c +++ b/src/misc/extra/extraUtilUtil.c @@ -377,6 +377,22 @@ double Extra_CpuTimeDouble() } #endif +/**Function************************************************************* + + Synopsis [Testing memory leaks.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Extra_MemTest() +{ + malloc( 1002 ); +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// |