Esempio n. 1
0
File: heap.c Progetto: fmccabe/cafe
void verifyHeap(heapPo H) {
  for (termPo t = H->start; t < H->curr;) {
    clssPo clss = classOf(t);
    if (isSpecialClass(clss)) {
      specialClassPo sClass = (specialClassPo) clss;
      t = sClass->scanFun(sClass, verifyScanHelper, H, t);
    } else {
      normalPo trm = C_TERM(t);
      labelPo lbl = C_LBL((termPo) clss);
      for (integer ix = 0; ix < labelArity(lbl); ix++) {
        validPtr(H, trm->args[ix]);
      }
      t = t + termSize(trm);
    }
  }
}
Esempio n. 2
0
File: osfun.cpp Progetto: mazonka/w
std::pair<int, int> os::termSize()
{
    static bool inited = false;
    static int width = 0;
    static int height = 0;

    if ( inited ) return std::make_pair(width, height);

    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
    width = w.ws_col;
    height = w.ws_row;

    inited = true;

    return termSize();
}
Esempio n. 3
0
File: code.c Progetto: fmccabe/cafe
integer codeLitCount(methodPo mtd) {
  assert(mtd != Null && mtd->pool != Null);
  normalPo lits = mtd->pool;
  return termSize(lits);
}