Bool SegBufCheck(SegBuf segbuf) { Buffer buffer; CHECKS(SegBuf, segbuf); buffer = MustBeA(Buffer, segbuf); CHECKD(Buffer, buffer); CHECKL(RankSetCheck(segbuf->rankSet)); if (buffer->mode & BufferModeTRANSITION) { /* nothing to check */ } else if ((buffer->mode & BufferModeATTACHED) == 0) { CHECKL(segbuf->seg == NULL); } else { /* The buffer is attached to a segment. */ CHECKL(segbuf->seg != NULL); CHECKD(Seg, segbuf->seg); /* To avoid recursive checking, leave it to SegCheck to make */ /* sure the buffer and segment fields tally. */ if (buffer->mode & BufferModeFLIPPED) { /* Only buffers that allocate pointers get flipped. */ CHECKL(segbuf->rankSet != RankSetEMPTY); } } return TRUE; }
void EPVMSetRankSet(Seg seg, RankSet rankSet) { EPVMSeg epvmSeg; EPVMSave save; AVERT(Seg, seg); epvmSeg = Seg2EPVMSeg(seg); AVERT(EPVMSeg, epvmSeg); AVER(RankSetCheck(rankSet)); save = epvmSeg->save; if (RankSetEMPTY == rankSet) { save->smallStringSeg = TRUE; } else { save->smallObjectSeg = TRUE; } SEG_SUPERCLASS(EPVMSegClass)->setRankSet(seg, rankSet); }
void EPVMSetRankAndSummary(Seg seg, RankSet rankSet, RefSet summary) { EPVMSeg epvmSeg; EPVMSave save; AVERT(Seg, seg); epvmSeg = Seg2EPVMSeg(seg); AVERT(EPVMSeg, epvmSeg); AVER(RankSetCheck(rankSet)); /* no useful test for summary */ UNUSED(summary); save = epvmSeg->save; if (RankSetEMPTY == rankSet) { save->smallStringSeg = TRUE; } else { save->smallObjectSeg = TRUE; } SEG_SUPERCLASS(EPVMSegClass)->setRankSummary(seg, rankSet, summary); }
Bool ArgCheckRankSet(Arg arg) { CHECKL(COMPATTYPE(RankSet, unsigned)); CHECKL(RankSetCheck(arg->val.u)); return TRUE; }