57 fprintf(outFile,
"Statistics for Dead Object Pool %s\n, id");
58 fprintf(outFile,
" Total memory allocations: %d\n", allocationCount);
59 fprintf(outFile,
" Unsuccessful requests: %d\n", allocationMisses);
60 fprintf(outFile,
" Successful requests: %d\n", allocationHits);
61 fprintf(outFile,
" Objects added back to the pool\n", allocationReclaim);
77 size_t largestSize = 0;
80 for (; deadLength != 0; deadLength = newObject->
getObjectSize()) {
81 if (deadLength >= length) {
92 else if (deadLength > largestSize) {
93 largestSize = deadLength;
97 newObject = newObject->
next;
101 if (largest != NULL) {
121 while (newObject->
isReal()) {
124 if (deadLength >= minSize && deadLength < smallestSize) {
126 smallestSize = deadLength;
127 smallest = newObject;
130 if (deadLength == minSize) {
134 newObject = newObject->
next;
137 if (smallest != NULL) {
162 while (insertPoint->
isReal()) {
168 insertPoint = insertPoint->
next;
188 while (insertPoint->
isReal()) {
191 if (insertPoint > obj) {
194 insertPoint = insertPoint->
next;
219 while (check != NULL && check->
isReal()) {
221 printf(
"Object at %p for length %zu overlaps object at %p for length %zu\n", obj, obj->
getObjectSize(), check, check->
getObjectSize());
#define VeryLargeObjectGrain
#define MaximumObjectSize
#define IsObjectGrained(o)
bool overlaps(DeadObject *o)
void insertBefore(DeadObject *newDead)
DeadObject * findSmallestFit(size_t minSize)
void dumpMemoryProfile(FILE *outfile)
void checkObjectGrain(DeadObject *obj)
void addSortedBySize(DeadObject *obj)
void checkObjectOverlap(DeadObject *obj)
DeadObject * findBestFit(size_t length)
void addSortedByLocation(DeadObject *obj)
static void logicError(const char *desc, const char *info1=NULL, size_t info2=0)