Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
CodeLocationCache Struct Reference
Collaboration diagram for CodeLocationCache:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CodeLocationCache ()
CodeLocationfindLocation (char *codeAddr)
void saveLocation (char *codeAddr, char symbolName[256], char fileName[256], UInt32 fileOffset)

Public Attributes

CodeLocation mEntries [kCodeLocationCacheSize]
CodeLocationmLocations
CodeLocation ** mLastLink

Detailed Description

Definition at line 27 of file gc_fragments.cpp.


Constructor & Destructor Documentation

Definition at line 38 of file gc_fragments.cpp.

       :      mLocations(NULL), mLastLink(&mLocations)
{
       // link all of the locations together in a list.
       int offset = kCodeLocationCacheSize;
       while (offset > 0) {
              CodeLocation* location = &mEntries[--offset];
              location->mNext = mLocations;
              mLocations = location;
       }
}

Member Function Documentation

Definition at line 50 of file gc_fragments.cpp.

{
       CodeLocation** link = &mLocations;
       CodeLocation* location = *link;
       while (location != NULL && location->mCodeAddr != NULL) {
              if (location->mCodeAddr == codeAddr) {
                     // move it to the head of the list.
                     if (location != mLocations) {
                            *link = location->mNext;
                            location->mNext = mLocations;
                            mLocations = location;
                     }
                     return location;
              }
              link = &location->mNext;
              location = *link;
              // maintain pointer to the last element in list for fast insertion.
              if (location != NULL)
                     mLastLink = link;
       }
       return NULL;
}

Here is the caller graph for this function:

void CodeLocationCache::saveLocation ( char *  codeAddr,
char  symbolName[256],
char  fileName[256],
UInt32  fileOffset 
)

Definition at line 73 of file gc_fragments.cpp.

{
       CodeLocation** link = mLastLink;
       CodeLocation* location = *link;
       mLastLink = &mLocations;
       
       // move it to the head of the list.
       if (location != mLocations) {
              *link = location->mNext;
              location->mNext = mLocations;
              mLocations = location;
       }
       
       // save the specified location.
       location->mCodeAddr = codeAddr;
       location->mFileOffset = fileOffset;
       ::strcpy(location->mSymbolName, symbolName);
       ::strcpy(location->mFileName, fileName);
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 28 of file gc_fragments.cpp.

Definition at line 30 of file gc_fragments.cpp.

Definition at line 29 of file gc_fragments.cpp.


The documentation for this struct was generated from the following file: