Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Public Attributes
MallocDict Struct Reference

#include <dict.h>

Collaboration diagram for MallocDict:
Collaboration graph
[legend]

List of all members.

Classes

struct  MallocDictEntry

Public Member Functions

 MallocDict (int buckets)
void rewind (void)
malloc_log_entrynext (void)
malloc_log_entry ** find (u_long addr)
void add (u_long addr, malloc_log_entry *log)
void remove (u_long addr)

Public Attributes

struct
MallocDict::MallocDictEntry ** 
buckets
int numBuckets
int iterNextBucket
MallocDictEntryiterNextEntry

Detailed Description

Definition at line 45 of file dict.h.


Class Documentation

struct MallocDict::MallocDictEntry

Definition at line 55 of file dict.h.

Collaboration diagram for MallocDict::MallocDictEntry:
Class Members
u_long addr
malloc_log_entry * logEntry
MallocDictEntry * next

Constructor & Destructor Documentation

Definition at line 46 of file dict.cpp.

{
    numBuckets = nb;
    buckets = (MallocDictEntry**) calloc(numBuckets, sizeof(MallocDictEntry*));
    rewind();
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 87 of file dict.cpp.

{
    u_long hash = addr % numBuckets;
    MallocDictEntry** mdep = &buckets[hash];
    MallocDictEntry* mde = new MallocDictEntry;
    mde->addr = addr;
    mde->logEntry = lep;
    mde->next = *mdep;
    *mdep = mde;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 74 of file dict.cpp.

{
    u_long hash = addr % numBuckets;
    MallocDictEntry* mde = buckets[hash];
    while (mde) {
       if (mde->addr == addr) {
           return &mde->logEntry;
       }
       mde = mde->next;
    }
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 59 of file dict.cpp.

Here is the caller graph for this function:

Definition at line 98 of file dict.cpp.

{
    u_long hash = addr % numBuckets;
    MallocDictEntry** mdep = &buckets[hash];
    MallocDictEntry* mde;

    while (NULL != (mde = *mdep)) {
       if (mde->addr == addr) {
           *mdep = mde->next;
/*XXX      delete mde; */
           return;
       }
       mdep = &mde->next;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 53 of file dict.cpp.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 63 of file dict.h.

Definition at line 64 of file dict.h.

Definition at line 61 of file dict.h.


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