IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3906


Ignore:
Timestamp:
May 12, 2005, 1:03:58 PM (21 years ago)
Author:
eugene
Message:

fixed ohana_memdump

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/src/ohana_allocate.c

    r3903 r3906  
    143143void ohana_memdump_func (int allmemory) {
    144144
    145   int i;
    146   char state;
     145  int i, Ns[3], N;
     146  char S[3];
    147147
    148148  if (Nmemlist == 0) {
     
    151151  }
    152152
     153  S[0] = 'A';
     154  S[1] = 'R';
     155  S[2] = 'F';
     156  Ns[0] = Ns[1] = Ns[2] = 0;
     157
    153158  for (i = 0; i < Nmemlist; i++) {
     159    if (memlist[i].state == STATE_ALLOC)   N = 0;
     160    if (memlist[i].state == STATE_REALLOC) N = 1;
     161    if (memlist[i].state == STATE_FREE)    N = 2;
     162    Ns[N] ++;
    154163    if ((allmemory == 0) && (memlist[i].state == STATE_FREE)) continue;
    155     if (memlist[i].state == STATE_ALLOC)   state = 'A';
    156     if (memlist[i].state == STATE_REALLOC) state = 'R';
    157     if (memlist[i].state == STATE_FREE)    state = 'F';
    158     fprintf (stderr, "%c %s %d\n", state, memlist[i].file, memlist[i].line);
     164    fprintf (stderr, "%3d %c %s %d\n", Ns[N], S[N], memlist[i].file, memlist[i].line);
    159165  }
     166  fprintf (stderr, "Nused: %d (Nalloc: %d, Nrealloc: %d), Nfree: %d\n",
     167           Ns[0]+Ns[1], Ns[0], Ns[1], Ns[2]);
    160168}
Note: See TracChangeset for help on using the changeset viewer.