|
|
@@ -912,11 +912,9 @@ void ResourceCache::ResetDependencies(Resource* resource)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const String& ResourceCache::PrintMemoryUsage() const
|
|
|
+String ResourceCache::PrintMemoryUsage() const
|
|
|
{
|
|
|
- static String output;
|
|
|
-
|
|
|
- output = "Resource Type Cnt Avg Max Budget Total\n\n";
|
|
|
+ String output = "Resource Type Cnt Avg Max Budget Total\n\n";
|
|
|
char outputLine[256];
|
|
|
|
|
|
unsigned totalResourceCt = 0;
|
|
|
@@ -950,9 +948,11 @@ const String& ResourceCache::PrintMemoryUsage() const
|
|
|
const String memTotalString = GetFileSizeString(cit->second_.memoryUse_);
|
|
|
const String resTypeName = context_->GetTypeName(cit->first_);
|
|
|
|
|
|
- snprintf(outputLine, sizeof(outputLine), "%-28s %4s %9s %9s %9s %9s\n", resTypeName.CString(), countString.CString(),
|
|
|
- memUseString.CString(), memMaxString.CString(), memBudgetString.CString(), memTotalString.CString());
|
|
|
- output += (const char*)outputLine;
|
|
|
+ memset(outputLine, ' ', 256);
|
|
|
+ outputLine[255] = 0;
|
|
|
+ sprintf(outputLine, "%-28s %4s %9s %9s %9s %9s\n", resTypeName.CString(), countString.CString(), memUseString.CString(), memMaxString.CString(), memBudgetString.CString(), memTotalString.CString());
|
|
|
+
|
|
|
+ output += ((const char*)outputLine);
|
|
|
}
|
|
|
|
|
|
if (totalResourceCt > 0)
|
|
|
@@ -963,9 +963,10 @@ const String& ResourceCache::PrintMemoryUsage() const
|
|
|
const String memMaxString = GetFileSizeString(totalLargest);
|
|
|
const String memTotalString = GetFileSizeString(totalUse);
|
|
|
|
|
|
- snprintf(outputLine, sizeof(outputLine), "%-28s %4s %9s %9s %9s %9s\n", "All", countString.CString(), memUseString.CString(),
|
|
|
- memMaxString.CString(), "-", memTotalString.CString());
|
|
|
- output += (const char*)outputLine;
|
|
|
+ memset(outputLine, ' ', 256);
|
|
|
+ outputLine[255] = 0;
|
|
|
+ sprintf(outputLine, "%-28s %4s %9s %9s %9s %9s\n", "All", countString.CString(), memUseString.CString(), memMaxString.CString(), "-", memTotalString.CString());
|
|
|
+ output += ((const char*)outputLine);
|
|
|
|
|
|
return output;
|
|
|
}
|