Example #1
0
Bool PoolDebugMixinCheck(PoolDebugMixin debug)
{
  /* Nothing to check about fenceTemplate */
  /* Nothing to check about fenceSize */
  /* Nothing to check about freeTemplate */
  /* Nothing to check about freeSize */
  if (debug->tagInit != NULL) {
    CHECKL(TagInitMethodCheck(debug->tagInit));
    /* Nothing to check about tagSize */
    CHECKD(Pool, debug->tagPool);
    CHECKL(COMPATTYPE(Addr, void*)); /* tagPool relies on this */
    /* Nothing to check about missingTags */
    CHECKL(SplayTreeCheck(&debug->index));
  }
  UNUSED(debug); /* see <code/mpm.c#check.unused> */
  return TRUE;
}
Res SplayTreeDescribe(SplayTree tree, mps_lib_FILE *stream,
                      SplayNodeDescribeMethod nodeDescribe) {
    Res res;

#if defined(AVER_AND_CHECK)
    if (!SplayTreeCheck(tree)) return ResFAIL;
    if (stream == NULL) return ResFAIL;
    if (!FUNCHECK(nodeDescribe)) return ResFAIL;
#endif

    res = WriteF(stream,
                 "Splay $P {\n", (WriteFP)tree,
                 "  compare $F\n", (WriteFF)tree->compare,
                 NULL);
    if (res != ResOK) return res;

    if (SplayTreeRoot(tree) != NULL) {
        res = SplayNodeDescribe(SplayTreeRoot(tree), stream, nodeDescribe);
        if (res != ResOK) return res;
    }

    res = WriteF(stream, "\n}\n", NULL);
    return res;
}