void (BTRes)(BT t, Index i) { AVERT(BT, t); /* Can't check i */ /* see macro in <code/mpm.h> */ BTRes(t, i); }
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)); }
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); } }