Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
C Class Reference
Inheritance diagram for C:
Inheritance graph
[legend]
Collaboration diagram for C:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 C (int levelArg)
 ~C ()
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
void operator delete (void *obj)
void Test (int iArg)

Static Public Member Functions

static void Test ()

Public Attributes

int level
Cleft
Cright
int i

Static Public Attributes

static int nFreed = 0
static int nAllocated = 0

Detailed Description

Definition at line 71 of file test_cpp.cc.


Constructor & Destructor Documentation

C::C ( int  levelArg) [inline]

Definition at line 74 of file test_cpp.cc.

                     : A( levelArg ), level( levelArg ) {
        nAllocated++;
        if (level > 0) {
            left = new C( level - 1 );
            right = new C( level - 1 );}
        else {
            left = right = 0;}}
C::~C ( ) [inline]

Definition at line 81 of file test_cpp.cc.

         {
        this->A::Test( level );
        nFreed++;
        my_assert( level == 0 ? 
                   left == 0 && right == 0 :
                   level == left->level + 1 && level == right->level + 1 );
        left = right = 0;
        level = -123456;}

Here is the call graph for this function:


Member Function Documentation

void gc::operator delete ( void obj) [inline, inherited]

Definition at line 221 of file gc_cpp.h.

                                           {
    GC_FREE( obj );}
void * gc::operator new ( size_t  size) [inline, inherited]

Definition at line 210 of file gc_cpp.h.

                                           {
    return GC_MALLOC( size );}
void * gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 213 of file gc_cpp.h.

                                                            {
    if (gcp == GC) 
        return GC_MALLOC( size );
    else if (gcp == PointerFreeGC)
       return GC_MALLOC_ATOMIC( size );
    else
        return GC_MALLOC_UNCOLLECTABLE( size );}
void A::Test ( int  iArg) [inline, inherited]

Definition at line 53 of file test_cpp.cc.

                          {
        my_assert( i == iArg );} 

Here is the caller graph for this function:

static void C::Test ( ) [inline, static]

Definition at line 89 of file test_cpp.cc.

                       {
        my_assert( nFreed <= nAllocated && nFreed >= .8 * nAllocated );}

Here is the caller graph for this function:


Member Data Documentation

int A::i [inherited]

Definition at line 55 of file test_cpp.cc.

Definition at line 95 of file test_cpp.cc.

Definition at line 94 of file test_cpp.cc.

int C::nAllocated = 0 [static]

Definition at line 93 of file test_cpp.cc.

int C::nFreed = 0 [static]

Definition at line 92 of file test_cpp.cc.

Definition at line 96 of file test_cpp.cc.


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