summaryrefslogtreecommitdiffstats
path: root/src/aig/aig
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-01-27 10:09:57 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2015-01-27 10:09:57 -0800
commitc58dd062591f47a79eee6b838b267e51534bbdd5 (patch)
tree981581468ad5f4ae7a7b9b1887edc647db1db4d2 /src/aig/aig
parent0f22046bcb71ba096fedfc6a75b6bc7fd4090e70 (diff)
downloadabc-c58dd062591f47a79eee6b838b267e51534bbdd5.tar.gz
abc-c58dd062591f47a79eee6b838b267e51534bbdd5.tar.bz2
abc-c58dd062591f47a79eee6b838b267e51534bbdd5.zip
Fixing reported memory alignment issue.
Diffstat (limited to 'src/aig/aig')
-rw-r--r--src/aig/aig/aigMem.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/aig/aig/aigMem.c b/src/aig/aig/aigMem.c
index a21b812d..7626b5fb 100644
--- a/src/aig/aig/aigMem.c
+++ b/src/aig/aig/aigMem.c
@@ -366,6 +366,10 @@ void Aig_MmFlexStop( Aig_MmFlex_t * p, int fVerbose )
char * Aig_MmFlexEntryFetch( Aig_MmFlex_t * p, int nBytes )
{
char * pTemp;
+#ifdef ABC_MEMALIGN
+ // extend size to max alignment
+ nBytes += (ABC_MEMALIGN - nBytes % ABC_MEMALIGN) % ABC_MEMALIGN;
+#endif
// check if there are still free entries
if ( p->pCurrent == NULL || p->pCurrent + nBytes > p->pEnd )
{ // need to allocate more entries
@@ -535,6 +539,10 @@ char * Aig_MmStepEntryFetch( Aig_MmStep_t * p, int nBytes )
{
if ( nBytes == 0 )
return NULL;
+#ifdef ABC_MEMALIGN
+ // extend size to max alignment
+ nBytes += (ABC_MEMALIGN - nBytes % ABC_MEMALIGN) % ABC_MEMALIGN;
+#endif
if ( nBytes > p->nMapSize )
{
if ( p->nChunks == p->nChunksAlloc )
@@ -564,6 +572,10 @@ void Aig_MmStepEntryRecycle( Aig_MmStep_t * p, char * pEntry, int nBytes )
{
if ( nBytes == 0 )
return;
+#ifdef ABC_MEMALIGN
+ // extend size to max alignment
+ nBytes += (ABC_MEMALIGN - nBytes % ABC_MEMALIGN) % ABC_MEMALIGN;
+#endif
if ( nBytes > p->nMapSize )
{
// ABC_FREE( pEntry );