当前位置: 首页>>代码示例>>C++>>正文


C++ defFree函数代码示例

本文整理汇总了C++中defFree函数的典型用法代码示例。如果您正苦于以下问题:C++ defFree函数的具体用法?C++ defFree怎么用?C++ defFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了defFree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: defFree

void defiNonDefault::addMinCuts(const char* name, int numCuts) {
  if (numMinCuts_ == minCutsAllocated_) {
    int i;
    char** cln;
    int*   nc;

    if (minCutsAllocated_ == 0)
      minCutsAllocated_ = 2;
    else
      minCutsAllocated_ *= 2;
    cln = (char**)defMalloc(sizeof(char*)* minCutsAllocated_);
    nc = (int*)defMalloc(sizeof(int)* minCutsAllocated_);
    for (i = 0; i < numMinCuts_; i++) {
      cln[i] = cutLayerName_[i];
      nc[i]  = numCuts_[i];
    }
    if (minCutsAllocated_ > 2) {
      defFree((char*)(cutLayerName_));
      defFree((char*)(numCuts_));
    }
    cutLayerName_ = cln;
    numCuts_ = nc;
  } 
  cutLayerName_[numMinCuts_] = (char*)defMalloc(strlen(name)+1);
  strcpy(cutLayerName_[numMinCuts_], DEFCASE(name));
  numCuts_[numMinCuts_] = numCuts;
  numMinCuts_ += 1;
}
开发者ID:li3939108,项目名称:DEF-Parser,代码行数:28,代码来源:defiNonDefault.cpp

示例2: defFree

void defiGroup::addRegionRect(int xl, int yl, int xh, int yh) {
  int i;
  if (numRects_ == rectsAllocated_) {
    int max = numRects_ * 2;
    int* nxl = (int*)defMalloc(sizeof(int)*max);
    int* nyl = (int*)defMalloc(sizeof(int)*max);
    int* nxh = (int*)defMalloc(sizeof(int)*max);
    int* nyh = (int*)defMalloc(sizeof(int)*max);
    max = numRects_;
    for (i = 0; i < max; i++) {
      nxl[i] = xl_[i];
      nyl[i] = yl_[i];
      nxh[i] = xh_[i];
      nyh[i] = yh_[i];
    }
    defFree((char*)(xl_));
    defFree((char*)(yl_));
    defFree((char*)(xh_));
    defFree((char*)(yh_));
    xl_ = nxl;
    yl_ = nyl;
    xh_ = nxh;
    yh_ = nyh;
    rectsAllocated_ *= 2;
  }

  i = numRects_;
  xl_[i] = xl;
  yl_[i] = yl;
  xh_[i] = xh;
  yh_[i] = yh;
  numRects_ += 1;
}
开发者ID:li3939108,项目名称:DEF-Parser,代码行数:33,代码来源:defiGroup.cpp

示例3: defFree

void defiComponent::setRegionBounds(int xl, int yl, int xh, int yh) {
  int i;
  i = this->numRects_;
  if (i == this->rectsAllocated_) {
    int max = this->rectsAllocated_ * 2;
    int* nxl = (int*)defMalloc(sizeof(int)*max);
    int* nyl = (int*)defMalloc(sizeof(int)*max);
    int* nxh = (int*)defMalloc(sizeof(int)*max);
    int* nyh = (int*)defMalloc(sizeof(int)*max);
    for (i = 0; i < this->numRects_; i++) {
      nxl[i] = this->rectXl_[i];
      nyl[i] = this->rectYl_[i];
      nxh[i] = this->rectXh_[i];
      nyh[i] = this->rectYh_[i];
    }
    defFree((char*)(this->rectXl_));
    defFree((char*)(this->rectYl_));
    defFree((char*)(this->rectXh_));
    defFree((char*)(this->rectYh_));
    this->rectXl_ = nxl;
    this->rectYl_ = nyl;
    this->rectXh_ = nxh;
    this->rectYh_ = nyh;
    this->rectsAllocated_ = max;
  }
  this->rectXl_[i] = xl;
  this->rectYl_[i] = yl;
  this->rectXh_[i] = xh;
  this->rectYh_[i] = yh;
  this->numRects_ += 1;
}
开发者ID:chuanwj,项目名称:vlsi-experimental,代码行数:31,代码来源:defiComponent.cpp

示例4: defFree

void defiRegion::addRect(int xl, int yl, int xh, int yh) {
  if (this->numRectangles_ == this->rectanglesAllocated_) {
    int i;
    int max = this->rectanglesAllocated_ = this->rectanglesAllocated_ * 2;
    int* newxl = (int*)defMalloc(sizeof(int)*max);
    int* newyl = (int*)defMalloc(sizeof(int)*max);
    int* newxh = (int*)defMalloc(sizeof(int)*max);
    int* newyh = (int*)defMalloc(sizeof(int)*max);
    for (i = 0; i < this->numRectangles_; i++) {
      newxl[i] = this->xl_[i];
      newyl[i] = this->yl_[i];
      newxh[i] = this->xh_[i];
      newyh[i] = this->yh_[i];
    }
    defFree((char*)(this->xl_));
    defFree((char*)(this->yl_));
    defFree((char*)(this->xh_));
    defFree((char*)(this->yh_));
    this->xl_ = newxl;
    this->yl_ = newyl;
    this->xh_ = newxh;
    this->yh_ = newyh;
  }
  this->xl_[this->numRectangles_] = xl;
  this->yl_[this->numRectangles_] = yl;
  this->xh_[this->numRectangles_] = xh;
  this->yh_[this->numRectangles_] = yh;
  this->numRectangles_ += 1;
}
开发者ID:chuanwj,项目名称:vlsi-experimental,代码行数:29,代码来源:defiRegion.cpp

示例5: defFree

void defiPath::Destroy() {
  this->defiPath::clear();
  if (this->keys_)
     defFree((char*)(this->keys_));
  if (this->data_)
     defFree((char*)(this->data_));
}
开发者ID:chuanwj,项目名称:vlsi-experimental,代码行数:7,代码来源:defiPath.cpp

示例6: defFree

void defiRegion::addRect(int xl, int yl, int xh, int yh) {
  if (numRectangles_ == rectanglesAllocated_) {
    int i;
    int max = rectanglesAllocated_ = rectanglesAllocated_ * 2;
    int* newxl = (int*)defMalloc(sizeof(int)*max);
    int* newyl = (int*)defMalloc(sizeof(int)*max);
    int* newxh = (int*)defMalloc(sizeof(int)*max);
    int* newyh = (int*)defMalloc(sizeof(int)*max);
    for (i = 0; i < numRectangles_; i++) {
      newxl[i] = xl_[i];
      newyl[i] = yl_[i];
      newxh[i] = xh_[i];
      newyh[i] = yh_[i];
    }
    defFree((char*)(xl_));
    defFree((char*)(yl_));
    defFree((char*)(xh_));
    defFree((char*)(yh_));
    xl_ = newxl;
    yl_ = newyl;
    xh_ = newxh;
    yh_ = newyh;
  }
  xl_[numRectangles_] = xl;
  yl_[numRectangles_] = yl;
  xh_[numRectangles_] = xh;
  yh_[numRectangles_] = yh;
  numRectangles_ += 1;
}
开发者ID:li3939108,项目名称:DEF-Parser,代码行数:29,代码来源:defiRegion.cpp

示例7: strlen

void defiRow::setup(const char* name, const char* macro, double x, double y,
		 int orient) {
  int len = strlen(name) + 1;

  this->defiRow::clear();

  if (len > this->nameLength_) {
    if (this->name_) defFree(this->name_);
    this->nameLength_ = len;
    this->name_ = (char*)defMalloc(len);
  }
  strcpy(this->name_, DEFCASE(name));

  len = strlen(macro) + 1;
  if (len > this->macroLength_) {
    if (this->macro_) defFree(this->macro_);
    this->macroLength_ = len;
    this->macro_ = (char*)defMalloc(len);
  }
  strcpy(this->macro_, DEFCASE(macro));

  this->x_ = x;
  this->y_ = y;
  this->xStep_ = 0.0;
  this->yStep_ = 0.0;
  this->xNum_ = 0.0;
  this->yNum_ = 0.0;
  this->orient_ = orient;

}
开发者ID:chuanwj,项目名称:vlsi-experimental,代码行数:30,代码来源:defiRowTrack.cpp

示例8: strlen

void defiFPC::addItem(char item, const char* name) {
  int len = strlen(name) + 1;

  if (namesUsed_ >= namesAllocated_) {
    char* newR;
    char** newN;
    int i;
    namesAllocated_ =
	namesAllocated_ ? namesAllocated_ * 2 : 8 ;
    newN = (char**) defMalloc(sizeof(char*) * namesAllocated_);
    newR = (char*) defMalloc(sizeof(char) * namesAllocated_);
    for (i = 0; i < namesUsed_; i++) {
      newN[i] = names_[i];
      newR[i] = rowOrComp_[i];
    }
    if (names_) defFree((char*)(names_));
    if (rowOrComp_) defFree(rowOrComp_);
    names_ = newN;
    rowOrComp_ = newR;
  }

  names_[namesUsed_] = (char*)defMalloc(len);
  strcpy(names_[namesUsed_], name);

  // 4 for bottomleft
  // 2 for row
  rowOrComp_[namesUsed_] = 
         (char)(((corner_ == 'B') ? 4 : 0) |
	 (item == 'R' ? 2 : 0));

  namesUsed_ += 1;
}
开发者ID:xiaoqingxu08,项目名称:ophidian,代码行数:32,代码来源:defiFPC.cpp

示例9: defFree

void defiPropType::bumpProps() {
    int lim = this->propertiesAllocated_;
    int news ;
    char** newpn;
    char*   newt;

    news = lim ? lim + lim : 2;

    newpn = (char**)defMalloc(sizeof(char*)*news);
    newt = (char*)defMalloc(sizeof(char)*news);

    lim = this->propertiesAllocated_ = news;

    if (lim > 2) {
        int i;
        for (i = 0; i < this->numProperties_; i++) {
            newpn[i] = this->propNames_[i];
            newt[i] = this->propTypes_[i];
        }
        defFree((char*)(this->propNames_));
        defFree((char*)(this->propTypes_));
    }
    this->propNames_ = newpn;
    this->propTypes_ = newt;
}
开发者ID:chuanwj,项目名称:vlsi-experimental,代码行数:25,代码来源:defiPropType.cpp

示例10: if

void defiBox::addPoint(defiGeometries* geom) {
  struct defiPoints* p;
  struct defiPoints* tp;
  int x, y;
  int i;

  p = (struct defiPoints*)defMalloc(sizeof(struct defiPoints));
  p->numPoints = geom->numPoints();
  p->x = (int*)defMalloc(sizeof(int)*p->numPoints);
  p->y = (int*)defMalloc(sizeof(int)*p->numPoints);
  for (i = 0; i < p->numPoints; i++) {
    geom->points(i, &x, &y);
    p->x[i] = x;
    p->y[i] = y;
    // for backward compatibility assign the first 2 points to xl, yl, xh & yh
    if (i == 0) {
      xl_ = x;
      yl_ = y;
    } else if (i == 1) {
      xh_ = x;
      yh_ = y;
    }
  }
  if (points_) {
     tp = points_;
     defFree((char*)(tp->x));
     defFree((char*)(tp->y));
     defFree((char*)(tp));
  }
  points_ = p;
}
开发者ID:li3939108,项目名称:DEF-Parser,代码行数:31,代码来源:defiSite.cpp

示例11: defFree

void defiBox::Destroy() {
  struct defiPoints* p;

  p = points_;
  if (p) {
    defFree((char*)(p->x));
    defFree((char*)(p->y));
    defFree((char*)(points_));
  }
}
开发者ID:li3939108,项目名称:DEF-Parser,代码行数:10,代码来源:defiSite.cpp

示例12: defFree

void defiRow::clear() {
  int i;
  for (i = 0; i < this->numProps_; i++) {
    defFree(this->propNames_[i]);
    defFree(this->propValues_[i]);
    this->propDValues_[i] = 0;
  }
  this->hasDo_ = 0;
  this->hasDoStep_ = 0;
  this->numProps_ = 0;
}
开发者ID:chuanwj,项目名称:vlsi-experimental,代码行数:11,代码来源:defiRowTrack.cpp

示例13: defFree

void defiFPC::Destroy() {

  this->defiFPC::clear();

  if (this->name_) defFree(this->name_);
  this->name_ = 0;
  this->nameLength_ = 0;

  defFree((char*)(this->names_));
  defFree((char*)(this->rowOrComp_));
  this->namesAllocated_ = 0;
}
开发者ID:chuanwj,项目名称:vlsi-experimental,代码行数:12,代码来源:defiFPC.cpp

示例14: clear

void defiFPC::Destroy() {

  clear();

  if (name_) defFree(name_);
  name_ = 0;
  nameLength_ = 0;

  defFree((char*)(names_));
  defFree((char*)(rowOrComp_));
  namesAllocated_ = 0;
}
开发者ID:xiaoqingxu08,项目名称:ophidian,代码行数:12,代码来源:defiFPC.cpp

示例15: defFree

void defiFill::clearPts() {
  struct defiPoints* p;
  int i;

  for (i = 0; i < numPts_; i++) {
    p = viaPts_[i];
    defFree((char*)(p->x));
    defFree((char*)(p->y));
    defFree((char*)(viaPts_[i]));
  }
  numPts_ = 0;
}
开发者ID:xiaoqingxu08,项目名称:ophidian,代码行数:12,代码来源:defiFill.cpp


注:本文中的defFree函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。