| 2990 | } |
| 2991 | |
| 2992 | static void printContents(const char* moment) |
| 2993 | { |
| 2994 | #if defined(MEM_DEBUG) && defined(DEBUG_GDS_ALLOC) |
| 2995 | if (!MemoryPool::externalMemoryManager) |
| 2996 | return; |
| 2997 | |
| 2998 | static bool alreadyPrinted = false; |
| 2999 | Firebird::AutoPtr<FILE> file; |
| 3000 | |
| 3001 | { // scope |
| 3002 | char name[PATH_MAX]; |
| 3003 | |
| 3004 | if (os_utils::getCurrentModulePath(name, sizeof(name))) |
| 3005 | strncat(name, ".memdebug.external.log", sizeof(name) - 1); |
| 3006 | else |
| 3007 | strcpy(name, "memdebug.external.log"); |
| 3008 | |
| 3009 | file = os_utils::fopen(name, alreadyPrinted ? "at" : "w+t"); |
| 3010 | } |
| 3011 | |
| 3012 | if (file) |
| 3013 | { |
| 3014 | fprintf(file, "********* Moment: %s\n", moment); |
| 3015 | |
| 3016 | MemoryPool::externalMemoryManager->print_contents(file, |
| 3017 | Firebird::MemoryPool::PRINT_USED_ONLY | Firebird::MemoryPool::PRINT_RECURSIVE); |
| 3018 | file = NULL; |
| 3019 | alreadyPrinted = true; |
| 3020 | } |
| 3021 | #endif |
| 3022 | } |
| 3023 | |
| 3024 | static void free() |
| 3025 | { |
nothing calls this directly
no test coverage detected