// Gives a detailed breakdown of the memory blocks in the zone // static void Z_Details_f(void) { Com_Printf("---------------------------------------------------------------------------\n"); Com_Printf("%20s %9s\n","Zone Tag","Bytes"); Com_Printf("%20s %9s\n","--------","-----"); for (int i=0; i<TAG_COUNT; i++) { int iThisCount = TheZone.Stats.iCountsPerTag[i]; int iThisSize = TheZone.Stats.iSizesPerTag [i]; if (iThisCount) { // can you believe that using %2.2f as a format specifier doesn't bloody work? // It ignores the left-hand specifier. Sigh, now I've got to do shit like this... // float fSize = (float)(iThisSize) / 1024.0f / 1024.0f; int iSize = fSize; int iRemainder = 100.0f * (fSize - floor(fSize)); Com_Printf("%20s %9d (%2d.%02dMB) in %6d blocks (%9d average)\n", psTagStrings[i], iThisSize, iSize,iRemainder, iThisCount, iThisSize / iThisCount ); } } Com_Printf("---------------------------------------------------------------------------\n"); Z_Stats_f(); }
void Z_Details_f(void) { assert(s_Initialized); // Display some tag specific information... Com_Printf("---------------------------------------------------------------------------\n"); Com_Printf("%20s %9s\n","Zone Tag","Bytes"); Com_Printf("%20s %9s\n","--------","-----"); for (int i=0; i<TAG_COUNT; i++) { int iThisCount = s_Stats.m_CountsPerTag[i]; int iThisSize = s_Stats.m_SizesPerTag[i]; if (iThisCount) { float fSize = (float)(iThisSize) / 1024.0f / 1024.0f; int iSize = fSize; int iRemainder = 100.0f * (fSize - floor(fSize)); Com_Printf("%d %9d (%2d.%02dMB) in %6d blocks (%9d average)\n", i, iThisSize, iSize, iRemainder, iThisCount, iThisSize / iThisCount); } } Com_Printf("---------------------------------------------------------------------------\n"); Z_Stats_f(); }