diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-01 01:35:04 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-01 01:35:04 -0700 |
commit | 6130e39b18b5f53902e4eab14f6d5cdde5219563 (patch) | |
tree | 0db0628479a1b750e9af1f66cb8379ebd0913d31 /src/sat/fraig/fraigMem.c | |
parent | f0e77f6797c0504b0da25a56152b707d3357f386 (diff) | |
download | abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.gz abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.bz2 abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.zip |
initial commit of public abc
Diffstat (limited to 'src/sat/fraig/fraigMem.c')
-rw-r--r-- | src/sat/fraig/fraigMem.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/sat/fraig/fraigMem.c b/src/sat/fraig/fraigMem.c index 1cc99790..ef52765e 100644 --- a/src/sat/fraig/fraigMem.c +++ b/src/sat/fraig/fraigMem.c @@ -18,6 +18,9 @@ #include "fraigInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -29,7 +32,7 @@ struct Fraig_MemFixed_t_ int nEntriesAlloc; // the total number of entries allocated int nEntriesUsed; // the number of entries in use int nEntriesMax; // the max number of entries in use - char * pEntriesFree; // the linked list of ABC_FREE entries + char * pEntriesFree; // the linked list of free entries // this is where the memory is stored int nChunkSize; // the size of one chunk @@ -130,7 +133,7 @@ char * Fraig_MemFixedEntryFetch( Fraig_MemFixed_t * p ) char * pTemp; int i; - // check if there are still ABC_FREE entries + // check if there are still free entries if ( p->nEntriesUsed == p->nEntriesAlloc ) { // need to allocate more entries assert( p->pEntriesFree == NULL ); @@ -159,7 +162,7 @@ char * Fraig_MemFixedEntryFetch( Fraig_MemFixed_t * p ) p->nEntriesUsed++; if ( p->nEntriesMax < p->nEntriesUsed ) p->nEntriesMax = p->nEntriesUsed; - // return the first entry in the ABC_FREE entry list + // return the first entry in the free entry list pTemp = p->pEntriesFree; p->pEntriesFree = *((char **)pTemp); return pTemp; @@ -180,7 +183,7 @@ void Fraig_MemFixedEntryRecycle( Fraig_MemFixed_t * p, char * pEntry ) { // decrement the counter of used entries p->nEntriesUsed--; - // add the entry to the linked list of ABC_FREE entries + // add the entry to the linked list of free entries *((char **)pEntry) = p->pEntriesFree; p->pEntriesFree = pEntry; } @@ -214,7 +217,7 @@ void Fraig_MemFixedRestart( Fraig_MemFixed_t * p ) } // set the last link *((char **)pTemp) = NULL; - // set the ABC_FREE entry list + // set the free entry list p->pEntriesFree = p->pChunks[0]; // set the correct statistics p->nMemoryAlloc = p->nEntrySize * p->nChunkSize; @@ -244,3 +247,5 @@ int Fraig_MemFixedReadMemUsage( Fraig_MemFixed_t * p ) //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + |