summaryrefslogtreecommitdiffstats
path: root/src/misc/nm
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
commit0871bffae307e0553e0c5186336189e8b55cf6a6 (patch)
tree4571d1563fe33a53a57fea1c35fb668b9d33265f /src/misc/nm
parentf936cc0680c98ffe51b3a1716c996072d5dbf76c (diff)
downloadabc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip
Version abc90215
Diffstat (limited to 'src/misc/nm')
-rw-r--r--src/misc/nm/nm.h8
-rw-r--r--src/misc/nm/nmApi.c12
-rw-r--r--src/misc/nm/nmInt.h8
-rw-r--r--src/misc/nm/nmTable.c10
4 files changed, 19 insertions, 19 deletions
diff --git a/src/misc/nm/nm.h b/src/misc/nm/nm.h
index c6344bbf..6f46c291 100644
--- a/src/misc/nm/nm.h
+++ b/src/misc/nm/nm.h
@@ -21,10 +21,6 @@
#ifndef __NM_H__
#define __NM_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/*
This manager is designed to store ID-to-name and name-to-ID mapping
for Boolean networks and And-Inverter Graphs.
@@ -54,6 +50,10 @@ extern "C" {
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+extern "C" {
+#endif
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/misc/nm/nmApi.c b/src/misc/nm/nmApi.c
index 576882a7..7f7cbb97 100644
--- a/src/misc/nm/nmApi.c
+++ b/src/misc/nm/nmApi.c
@@ -43,15 +43,15 @@ Nm_Man_t * Nm_ManCreate( int nSize )
{
Nm_Man_t * p;
// allocate the table
- p = ALLOC( Nm_Man_t, 1 );
+ p = ABC_ALLOC( Nm_Man_t, 1 );
memset( p, 0, sizeof(Nm_Man_t) );
// set the parameters
p->nSizeFactor = 2; // determined the limit on the grow of data before the table resizes
p->nGrowthFactor = 3; // determined how much the table grows after resizing
// allocate and clean the bins
p->nBins = Cudd_PrimeNm(nSize);
- p->pBinsI2N = ALLOC( Nm_Entry_t *, p->nBins );
- p->pBinsN2I = ALLOC( Nm_Entry_t *, p->nBins );
+ p->pBinsI2N = ABC_ALLOC( Nm_Entry_t *, p->nBins );
+ p->pBinsN2I = ABC_ALLOC( Nm_Entry_t *, p->nBins );
memset( p->pBinsI2N, 0, sizeof(Nm_Entry_t *) * p->nBins );
memset( p->pBinsN2I, 0, sizeof(Nm_Entry_t *) * p->nBins );
// start the memory manager
@@ -73,9 +73,9 @@ Nm_Man_t * Nm_ManCreate( int nSize )
void Nm_ManFree( Nm_Man_t * p )
{
Extra_MmFlexStop( p->pMem );
- FREE( p->pBinsI2N );
- FREE( p->pBinsN2I );
- FREE( p );
+ ABC_FREE( p->pBinsI2N );
+ ABC_FREE( p->pBinsN2I );
+ ABC_FREE( p );
}
/**Function*************************************************************
diff --git a/src/misc/nm/nmInt.h b/src/misc/nm/nmInt.h
index 028316e1..03948f22 100644
--- a/src/misc/nm/nmInt.h
+++ b/src/misc/nm/nmInt.h
@@ -21,10 +21,6 @@
#ifndef __NM_INT_H__
#define __NM_INT_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -37,6 +33,10 @@ extern "C" {
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+extern "C" {
+#endif
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/misc/nm/nmTable.c b/src/misc/nm/nmTable.c
index e50388ba..a147b16c 100644
--- a/src/misc/nm/nmTable.c
+++ b/src/misc/nm/nmTable.c
@@ -259,8 +259,8 @@ clk = clock();
// get the new table size
nBinsNew = Cudd_PrimeCopy( p->nGrowthFactor * p->nBins );
// allocate a new array
- pBinsNewI2N = ALLOC( Nm_Entry_t *, nBinsNew );
- pBinsNewN2I = ALLOC( Nm_Entry_t *, nBinsNew );
+ pBinsNewI2N = ABC_ALLOC( Nm_Entry_t *, nBinsNew );
+ pBinsNewN2I = ABC_ALLOC( Nm_Entry_t *, nBinsNew );
memset( pBinsNewI2N, 0, sizeof(Nm_Entry_t *) * nBinsNew );
memset( pBinsNewN2I, 0, sizeof(Nm_Entry_t *) * nBinsNew );
// rehash entries in Id->Name table
@@ -285,10 +285,10 @@ clk = clock();
}
assert( Counter == p->nEntries );
// printf( "Increasing the structural table size from %6d to %6d. ", p->nBins, nBinsNew );
-// PRT( "Time", clock() - clk );
+// ABC_PRT( "Time", clock() - clk );
// replace the table and the parameters
- free( p->pBinsI2N );
- free( p->pBinsN2I );
+ ABC_FREE( p->pBinsI2N );
+ ABC_FREE( p->pBinsN2I );
p->pBinsI2N = pBinsNewI2N;
p->pBinsN2I = pBinsNewN2I;
p->nBins = nBinsNew;