summaryrefslogtreecommitdiffstats
path: root/src/misc/vec
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-01-10 17:19:54 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2015-01-10 17:19:54 -0800
commit26b8116ac649f977333a1771dfaac0ae3b18a97b (patch)
treebe68adbcb65920799a3caf6394c22da56ea3a72d /src/misc/vec
parent63ce84d824c54d8ea0d22912bd6f69cf7c284324 (diff)
downloadabc-26b8116ac649f977333a1771dfaac0ae3b18a97b.tar.gz
abc-26b8116ac649f977333a1771dfaac0ae3b18a97b.tar.bz2
abc-26b8116ac649f977333a1771dfaac0ae3b18a97b.zip
Changing memory model of Cba_Ntk_t.
Diffstat (limited to 'src/misc/vec')
-rw-r--r--src/misc/vec/vecMem.h8
-rw-r--r--src/misc/vec/vecSet.h14
2 files changed, 22 insertions, 0 deletions
diff --git a/src/misc/vec/vecMem.h b/src/misc/vec/vecMem.h
index c4868807..72b653b7 100644
--- a/src/misc/vec/vecMem.h
+++ b/src/misc/vec/vecMem.h
@@ -84,6 +84,14 @@ struct Vec_Mem_t_
SeeAlso []
***********************************************************************/
+static inline void Vec_MemAlloc_( Vec_Mem_t * p, int nEntrySize, int LogPageSze )
+{
+ memset( p, 0, sizeof(Vec_Mem_t) );
+ p->nEntrySize = nEntrySize;
+ p->LogPageSze = LogPageSze;
+ p->PageMask = (1 << p->LogPageSze) - 1;
+ p->iPage = -1;
+}
static inline Vec_Mem_t * Vec_MemAlloc( int nEntrySize, int LogPageSze )
{
Vec_Mem_t * p;
diff --git a/src/misc/vec/vecSet.h b/src/misc/vec/vecSet.h
index 40318b48..ac3dd95c 100644
--- a/src/misc/vec/vecSet.h
+++ b/src/misc/vec/vecSet.h
@@ -242,6 +242,20 @@ static inline int Vec_SetAppendS( Vec_Set_t * p, int nSize )
Vec_SetIncLimitS( p->pPages[p->iPageS], nWords );
return Vec_SetHandCurrentS(p) - nWords;
}
+static inline int Vec_SetFetchH( Vec_Set_t * p, int nBytes )
+{
+ return Vec_SetAppend(p, NULL, (nBytes + 3) >> 2);
+}
+static inline void * Vec_SetFetch( Vec_Set_t * p, int nBytes )
+{
+ return (void *)Vec_SetEntry( p, Vec_SetFetchH(p, nBytes) );
+}
+static inline char * Vec_SetStrsav( Vec_Set_t * p, char * pName )
+{
+ char * pStr = (char *)Vec_SetFetch( p, strlen(pName) + 1 );
+ strcpy( pStr, pName );
+ return pStr;
+}
/**Function*************************************************************