mirror of https://github.com/YosysHQ/abc.git
Fix build errors and spacing
This commit is contained in:
parent
cfd526afd0
commit
2eb8f38cd1
|
|
@ -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<<IVY_PAGE_SIZE) + 64;
|
||||
PMemAlign = PMemAlign + 64 - (((int)(ABC_PTRUINT_T)PMemAlign) & 63);
|
||||
pMemory = (Hop_Obj_t *)PMemAlign;
|
||||
pMemory = pMemory + 64 - (((int)(ABC_PTRUINT_T)pMemory) & 63);
|
||||
pMemory = ABC_ALLOC( char, nBytes );
|
||||
Vec_PtrPush( p->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 *) );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in New Issue