diff --git a/src/aig/hop/hopMem.c b/src/aig/hop/hopMem.c index e6142e95e..50932971c 100644 --- a/src/aig/hop/hopMem.c +++ b/src/aig/hop/hopMem.c @@ -88,31 +88,32 @@ void Hop_ManStopMemory( Hop_Man_t * p ) ***********************************************************************/ void Hop_ManAddMemory( Hop_Man_t * p ) { - Hop_Obj_t * pMemory; - char *PMemAlign = 0; + char * pMemory = 0; + Hop_Obj_t * pEntry, * pNext; int i, nBytes; assert( sizeof(Hop_Obj_t) <= 64 ); assert( p->pListFree == NULL ); // assert( (Hop_ManObjNum(p) & IVY_PAGE_MASK) == 0 ); // allocate new memory page nBytes = sizeof(Hop_Obj_t) * (1<vChunks, pMemory ); // align memory at the 32-byte boundary pMemory = pMemory + 64 - (((int)(ABC_PTRUINT_T)pMemory) & 63); // remember the manager in the first entry Vec_PtrPush( p->vPages, pMemory ); // break the memory down into nodes - p->pListFree = (Hop_Obj_t *)pMemory; + pEntry = (Hop_Obj_t *)pMemory; + p->pListFree = pEntry; for ( i = 1; i <= IVY_PAGE_MASK; i++ ) { - Hop_Obj_t *NextPtr = pMemory + 1; - memcpy(pMemory, &NextPtr, sizeof(Hop_Obj_t *)); - pMemory += 1; + pNext = pEntry + 1; + memcpy( pEntry, &pNext, sizeof(Hop_Obj_t *) ); + pEntry++; } - Hop_Obj_t *NullPtr = NULL; - memcpy(pMemory, &NullPtr, sizeof(Hop_Obj_t *)); + pNext = NULL; + memcpy( pEntry, &pNext, sizeof(Hop_Obj_t *) ); } ////////////////////////////////////////////////////////////////////////