Logo Search packages:      
Sourcecode: leaktracer version File versions  Download package

void LeakTracer::writeLeakReport (  )

write a Report over leaks, e.g. still pending deletes

Definition at line 462 of file LeakTracer.cc.

References leaks.

Referenced by progAbort().

                                 {
      initialize();

      if (newCount > 0) {
            fprintf(report, "# LeakReport\n");
            fprintf(report, "# %10s | %9s  # Pointer Addr\n",
                  "from new @", "size");
      }
      for (int i = 0; i <  leaksCount; i++)
            if (leaks[i].addr != NULL) {
                  // This ought to be 64-bit safe?
                  fprintf(report, "L %10p   %9ld  # %p\n",
                        leaks[i].allocAddr,
                        (long) leaks[i].size,
                        leaks[i].addr);
            }
      fprintf(report, "# total allocation requests: %6ld ; max. mem used"
            " %d kBytes\n", totalAllocations, maxAllocated / 1024);
      fprintf(report, "# leak %6d Bytes\t:-%c\n", currentAllocated,
            (currentAllocated == 0) ? ')' : '(');
      if (currentAllocated > 50 * 1024) {
            fprintf(report, "# .. that is %d kByte!! A lot ..\n", 
                  currentAllocated / 1024);
      }
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index