libsrc/allocdebug.cxx File Reference

??? More...

#include "udanax.h"

Include dependency graph for allocdebug.cxx:

Include dependency graph

Go to the source code of this file.

Functions

void analyzeanddebug (char *ptr)
 ???

void lookatalloc2 (HEADER *abaseallocated)
 ???


Detailed Description

???

(to be defined)

Definition in file allocdebug.cxx.


Function Documentation

void analyzeanddebug char *  ptr  )  [static]
 

???

(to be defined)

Definition at line 82 of file allocdebug.cxx.

References CBCTAG, CONTEXT2DTAG, CONTEXTTAG, CRUMCONTEXTTAG, CUCTAG, dumpcontext(), dumpitem(), dumpspan(), dumptumbler(), FREEDISKLOAFTAG, HEADER, INTTAG, ISPANTAG, ITEMTAG, L, LINKTAG, SESSTAG, SPANTAG, SPORGLTAG, tagtype, TUMBLERTAG, VSPANTAG, and VSPECTAG.

Referenced by lookatalloc2().

00084 {                                      /* ptr to thing with alloc header and * tag header */
00085 #ifndef DISTRIBUTION
00086     tagtype tag;
00087     char *tagptr;
00088     HEADER *allocptr;
00089 
00090     allocptr = (HEADER *) ptr;
00091     tagptr = ptr + sizeof(HEADER);
00092     tag = *tagptr;
00093     ptr = tagptr + sizeof(tagtype);
00094 /* L("\n size is %d ", ((HEADER *)allocptr)->s.size * sizeof(HEADER)); */
00095     if (tag == SESSTAG) {              /* undifferientated session alloced stuff */
00096 
00097     }                                  /* else if(tag & SESSTAG){ //tagged * session alloced stuff// switch(tag *
00098                                         * &~SESSTAG){ } } */
00099     else {
00100         switch (tag) {
00101         case INTTAG:
00102             L("int  in allocspace \n");
00103             break;
00104 
00105         case ITEMTAG:
00106             L("item  in allocspace \n");
00107             dumpitem((typeitem *) ptr);
00108             break;
00109 
00110         case CONTEXTTAG:
00111             L("context %x in allocspace \n", (int) ptr);
00112             dumpcontext((Context *) ptr);
00113             break;
00114 
00115         case CONTEXT2DTAG:
00116             L("context2d %x in allocspace \n", (int) ptr);
00117             break;
00118 
00119         case CRUMCONTEXTTAG:
00120             L("crumcontext  in allocspace \n");
00121             break;
00122 
00123         case CUCTAG:
00124             break;                     /* L("cuc in allocspace"); dump(ptr); break; */
00125 
00126         case CBCTAG:
00127             break;                     /* L("cbc in allocspace"); dump(ptr); break; */
00128 
00129         case SPANTAG:
00130             L("span  in allocspace \n");
00131             dumpspan((typespan *) ptr);
00132             break;
00133 
00134         case TUMBLERTAG:
00135             L("tumbler  in allocspace \n");
00136             dumptumbler((Tumbler *) ptr);
00137             break;
00138 
00139         case ISPANTAG:
00140             L("aspan  in allocspace \n");
00141             break;
00142 
00143         case VSPANTAG:
00144             L("vspan  in allocspace \n");
00145             break;
00146 
00147         case SPORGLTAG:
00148             L("sporgl  in allocspace \n");
00149             break;
00150 
00151         case LINKTAG:
00152             L("link  in allocspace \n");
00153             break;
00154 
00155         case VSPECTAG:
00156             L("vspec  in allocspace \n");
00157             break;
00158 
00159         case FREEDISKLOAFTAG:
00160             L("freediskloaf  in allocspace \n");
00161             break;
00162 
00163         default:
00164             L("randomunidentified thing  in allocspace \n");
00165             break;
00166         }
00167     }
00168 #endif
00169 }

void lookatalloc2 HEADER abaseallocated  ) 
 

???

(to be defined)

Definition at line 179 of file allocdebug.cxx.

References analyzeanddebug(), HEADER, L, max, and header::s.

Referenced by lookatalloc().

00181 {                                      /* baseallocated is statics in alloc.d */
00182 #ifndef DISTRIBUTION
00183     register HEADER *p;
00184     unsigned allocated = 0, unallocated = 0, maxunallocatedblock = 0;   /* in header units */
00185 
00186     p = abaseallocated->s.ptr;
00187     for (; p < abaseallocated->s.ptr + abaseallocated->s.size;) {
00188         if (!p->s.ptr) {               /* allocated */
00189             analyzeanddebug((char *) p);
00190             allocated += p->s.size;
00191         } else {                       /* unallocated */
00192             unallocated += p->s.size;
00193             maxunallocatedblock = max(p->s.size, maxunallocatedblock);
00194         }
00195 /* step past current one */
00196         p = p + p->s.size;
00197 
00198     }
00199     L(" allocated = %d unallocated = %d maxunallocatedblock = %d\n", allocated * sizeof(HEADER),
00200             unallocated * sizeof(HEADER), maxunallocatedblock * sizeof(HEADER));
00201 #endif
00202 }


Generated on Sun Aug 21 04:18:24 2005 for Udanax-Green by doxygen1.3.4