示例#1
0
文件: buffer.c 项目: Ravenbrook/mps
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;
}
示例#2
0
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);
}
示例#3
0
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);
}
示例#4
0
Bool ArgCheckRankSet(Arg arg) {
  CHECKL(COMPATTYPE(RankSet, unsigned));
  CHECKL(RankSetCheck(arg->val.u));
  return TRUE;
}