21 #ifndef ABC__aig__ivy__attr_h
22 #define ABC__aig__ivy__attr_h
88 p->nAttrSize = nAttrSize;
110 p->pAttrs = (
void **)
ALLOC(
int, nAttrs );
111 memset( (
int *)p->pAttrs, 0,
sizeof(
int) * nAttrs );
132 p->pAttrs =
ALLOC(
void *, nAttrs );
133 memset( p->pAttrs, 0,
sizeof(
void *) * nAttrs );
154 p->pAttrs =
ALLOC(
void *, nAttrs );
155 for ( i = 0; i < p->nAttrs; i++ )
158 memset( p->pAttrs[i], 0, nAttrSize );
177 if ( p->pFuncFreeObj )
182 for ( i = 0; i < p->nAttrs; i++ )
183 if ( ((
int *)p->pAttrs)[i] )
184 p->pFuncFreeObj( p->pManAttr, (
void *)((
int *)p->pAttrs)[i] );
188 for ( i = 0; i < p->nAttrs; i++ )
190 p->pFuncFreeObj( p->pManAttr, p->pAttrs[i] );
194 if ( p->pManAttr && p->pFuncFreeMan )
195 p->pFuncFreeMan( p->pManAttr );
218 if ( Id >= p->nAttrs )
220 return ((
int *)p->pAttrs)[Id];
237 if ( Id >= p->nAttrs )
239 return p->pAttrs[Id];
256 ((
int *)p->pAttrs)[Id] = Attr;
273 assert( p->pManMem == NULL );
274 p->pAttrs[Id] = pAttr;
291 if ( Id >= p->nAttrs )
294 int i, nAttrsOld = p->nAttrs;
296 p->nAttrs = p->nAttrs? 2*p->nAttrs : 1024;
297 p->pAttrs =
realloc( p->pAttrs,
sizeof(
int) * p->nAttrs );
299 for ( i = nAttrsOld; i < p->nAttrs; i++ )
300 ((
int *)p->pAttrs)[Id] = 0;
302 return ((
int *)p->pAttrs) + Id;
319 if ( Id >= p->nAttrs )
322 int i, nAttrsOld = p->nAttrs;
324 p->nAttrs = p->nAttrs? 2*p->nAttrs : 1024;
325 p->pAttrs =
realloc( p->pAttrs,
sizeof(
void *) * p->nAttrs );
327 for ( i = nAttrsOld; i < p->nAttrs; i++ )
328 p->pAttrs[Id] = NULL;
331 if ( p->pManMem && p->pAttrs[Id] != NULL )
334 memset( p->pAttrs[Id], 0, p->nAttrSize );
336 return p->pAttrs + Id;
401 assert( p->pManMem == NULL );
static void Attr_ManWriteAttrPtr(Attr_Man_t *p, int Id, void *pAttr)
static void Attr_ManSetAttrPtr(Attr_Man_t *p, int Id, void *pAttr)
static Attr_Man_t * Attr_ManStartPtrMem(int nAttrs, int nAttrSize)
static void * Attr_ManFetchAttrPtr(Attr_Man_t *p, int Id)
static Attr_Man_t * Attr_ManAlloc(int nAttrSize, int fManMem)
MACRO DEFINITIONS ///.
static void ** Attr_ManFetchSpotPtr(Attr_Man_t *p, int Id)
typedefABC_NAMESPACE_HEADER_START struct Attr_ManStruct_t_ Attr_Man_t
INCLUDES ///.
static int Attr_ManReadAttrInt(Attr_Man_t *p, int Id)
static void Attr_ManStop(Attr_Man_t *p)
static Attr_Man_t * Attr_ManStartInt(int nAttrs)
static void Attr_ManSetAttrInt(Attr_Man_t *p, int Id, int Attr)
void(* pFuncFreeMan)(void *)
static void Attr_ManWriteAttrInt(Attr_Man_t *p, int Id, int Attr)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
void(* pFuncFreeObj)(void *, void *)
#define ABC_NAMESPACE_HEADER_END
static int * Attr_ManFetchSpotInt(Attr_Man_t *p, int Id)
static int Attr_ManFetchAttrInt(Attr_Man_t *p, int Id)
static void * Attr_ManReadAttrPtr(Attr_Man_t *p, int Id)
Extra_MmFixed_t * pManMem
static Attr_Man_t * Attr_ManStartPtr(int nAttrs)