in src/cas/lowlevel_fsheap.cpp [195:268]
void FSHeap::print(ostream& os) const {
os << "=============================================" << endl;
#ifdef BYEBYEPTRS
void * h;
size_t i;
size_t lastHeapCell = iv_clTemporaryHeap.getLastHeapCell();
size_t topOfHeap = iv_clTemporaryHeap.getTopOfHeap();
if (true) {
os << "Plain HEAP:" << endl;
h=iv_clTemporaryHeap.getHeapStart();
i=0;
for (h=1; h< lastHeapCell; ++h) {
os << i++ << " (" << (ptrdiff_t) h << ", " << h << ") : | " << ((ptrdiff_t) (*h));
if (h == topOfHeap) {
os << " <---" << endl;
break;
}
os << endl;
}
}
os << "-----------------------------" << endl;
UChar* uc = iv_clTemporaryStringHeap.getHeapStart();
size_t topOfStringHeap = iv_clTemporaryStringHeap.getTopOfHeap();
if (false) {
os << "PLAIN STRING TABLE" << endl;
while ((uc-iv_clTemporaryStringHeap.getHeapStart())<topOfStringHeap) {
os << (ptrdiff_t) uc << ": " << *uc << "(" << (ptrdiff_t) (*uc) << ")" << endl;
++uc;
}
os << "-----------------------------" << endl;
uc = iv_clTemporaryStringHeap.getHeapStart();
topOfStringHeap = iv_clTemporaryStringHeap.getTopOfHeap();
}
os << "String table: " << endl;
while ( (uc-iv_clTemporaryStringHeap.getHeapStart()) < topOfStringHeap) {
UnicodeStringRef uls(uc);
os << " " << (ptrdiff_t) uc << ": " << uls << endl;
uc += uls.length() + 1;
}
os << "-----------------------------" << endl;
os << "HEAP:" << endl;
h = iv_clTemporaryHeap.getHeapStart() + 1;
int n=1;
while (h<lastHeapCell) {
if ( (*h) == 0 ) {
return;
}
TyFS currentFS = h;
TyFSType type = getType( h );
icu::UnicodeString typeName = iv_rclTypeSystem.getTypeName(type);
os << n++ << ": (" << (ptrdiff_t) h << ")| " << typeName << endl;
++h;
int i;
for (i=0; i< (int) iv_rclTypeSystem.getFeatureNumber(type); ++i) {
os << n++ << ": (" << (ptrdiff_t) h << ")| " << ((ptrdiff_t) (*h)) << endl;
++h;
}
if (iv_rclTypeSystem.subsumes( uima::internal::gs_tyArrayBaseType, type) ) {
++h; // for the array size field
int iArraySize = getArraySize(currentFS);
for (i=0; i<iArraySize; ++i) {
os << n++ << ": (" << (ptrdiff_t) h << ")| " << ((ptrdiff_t) (*h)) << endl;
++h;
}
}
}
#endif
}