Exemple #1
0
void (BTRes)(BT t, Index i)
{
  AVERT(BT, t);
  /* Can't check i */

  /* see macro in <code/mpm.h> */
  BTRes(t, i);
}
Exemple #2
0
void PageInit(Chunk chunk, Index pi)
{
  Page page;

  AVERT_CRITICAL(Chunk, chunk);
  AVER_CRITICAL(pi < chunk->pages);

  page = ChunkPage(chunk, pi);

  BTRes(chunk->allocTable, pi);
  PageSetPool(page, NULL);
  PageSetType(page, PageStateFREE);
  RingInit(PageSpareRing(page));
}
Exemple #3
0
void BTCopyOffsetRange(BT fromBT, BT toBT,
                       Index fromBase, Index fromLimit,
                       Index toBase, Index toLimit)
{
  Index fromBit, toBit;

  AVERT(BT, fromBT);
  AVERT(BT, toBT);
  AVER(fromBT != toBT);
  AVER(fromBase < fromLimit);
  AVER(toBase < toLimit);
  AVER((fromLimit - fromBase) == (toLimit - toBase));

  for (fromBit = fromBase, toBit = toBase;
       fromBit < fromLimit;
       ++fromBit, ++toBit) {
    if (BTGet(fromBT, fromBit))
      BTSet(toBT, toBit);
    else
      BTRes(toBT, toBit);
  }
}