MCPcopy Create free account
hub / github.com/boostorg/build / D

Class D

v2/engine/boehm_gc/tests/test_cpp.cc:117–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115
116
117class D: public gc {public:
118 /* A collectable class with a static member function to be used as
119 an explicit clean-up function supplied to ::new. */
120
121 D( int iArg ): i( iArg ) {
122 nAllocated++;}
123 static void CleanUp( void* obj, void* data ) {
124 D* self = (D*) obj;
125 nFreed++;
126 my_assert( self->i == (int) (GC_word) data );}
127 static void Test() {
128 my_assert( nFreed >= .8 * nAllocated );}
129
130 int i;
131 static int nFreed;
132 static int nAllocated;};
133
134int D::nFreed = 0;
135int D::nAllocated = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected