abc/src/phys/place/place_base.c
// --------------------------------------------------------------------
// addConcreteCell()
//
/// The cell object must already be allocated and the ID must be set
/// appropriately.
//
// --------------------------------------------------------------------
addConcreteCell()
The cell object must already be allocated and the ID must be set
appropriately.
addConcreteCell () The cell object must already be allocated and the ID must be set appropriately .
void   addConcreteCell(ConcreteCell *cell) {
  assert(cell);
  assert(cell->m_id >= 0);
  if (cell->m_id >= g_place_concreteCellsSize) {
    g_place_concreteCellsSize = (cell->m_id > g_place_concreteCellsSize ? 
                                 cell->m_id : g_place_concreteCellsSize);
    g_place_concreteCellsSize *= 1.5;
    g_place_concreteCellsSize += 20;
    g_place_concreteCells = (ConcreteCell**)realloc(g_place_concreteCells, 
          sizeof(ConcreteCell*)*g_place_concreteCellsSize);
    assert(g_place_concreteCells);
  }
  if (cell->m_id >= g_place_numCells) {
    memset(&(g_place_concreteCells[g_place_numCells]), 0,
          sizeof(ConcreteCell*)*(cell->m_id+1-g_place_numCells));
    g_place_numCells = cell->m_id+1;
  }
  g_place_concreteCells[cell->m_id] = cell;
}
void addConcreteCell ( ConcreteCell * cell ) { assert ( cell ) ; assert ( cell -> m_id >= 0 ) ; if ( cell -> m_id >= g_place_concreteCellsSize ) { g_place_concreteCellsSize = ( cell -> m_id > g_place_concreteCellsSize ? cell -> m_id : g_place_concreteCellsSize ) ; g_place_concreteCellsSize *= 1.5 ; g_place_concreteCellsSize += 20 ; g_place_concreteCells = ( ConcreteCell * * ) realloc ( g_place_concreteCells , sizeof ( ConcreteCell * ) * g_place_concreteCellsSize ) ; assert ( g_place_concreteCells ) ; } if ( cell -> m_id >= g_place_numCells ) { memset ( & ( g_place_concreteCells [ g_place_numCells ] ) , 0 , sizeof ( ConcreteCell * ) * ( cell -> m_id + 1 - g_place_numCells ) ) ; g_place_numCells = cell -> m_id + 1 ; } g_place_concreteCells [ cell -> m_id ] = cell ; }
addConcreteCell()
The cell object must already be allocated and the ID must be set
appropriately.
addConcreteCell () The cell object must already be allocated and the ID must be set appropriately .