summaryrefslogtreecommitdiffstats
path: root/src/misc/extra
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/extra')
-rw-r--r--src/misc/extra/extra.h21
-rw-r--r--src/misc/extra/extraUtilMemory.c4
-rw-r--r--src/misc/extra/extraUtilUtil.c16
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 ///
////////////////////////////////////////////////////////////////////////