Changeset 3906
- Timestamp:
- May 12, 2005, 1:03:58 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libohana/src/ohana_allocate.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libohana/src/ohana_allocate.c
r3903 r3906 143 143 void ohana_memdump_func (int allmemory) { 144 144 145 int i ;146 char state;145 int i, Ns[3], N; 146 char S[3]; 147 147 148 148 if (Nmemlist == 0) { … … 151 151 } 152 152 153 S[0] = 'A'; 154 S[1] = 'R'; 155 S[2] = 'F'; 156 Ns[0] = Ns[1] = Ns[2] = 0; 157 153 158 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] ++; 154 163 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); 159 165 } 166 fprintf (stderr, "Nused: %d (Nalloc: %d, Nrealloc: %d), Nfree: %d\n", 167 Ns[0]+Ns[1], Ns[0], Ns[1], Ns[2]); 160 168 }
Note:
See TracChangeset
for help on using the changeset viewer.
