Browse Source

不使用堆,使用栈。

sat23 3 năm trước cách đây
mục cha
commit
b4ec8ba913
1 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 3 6
      TCLCommand/TCLCommand/utils.cpp

+ 3 - 6
TCLCommand/TCLCommand/utils.cpp

@@ -22,12 +22,9 @@ namespace utils
 
     std::string _dprintf(CHAR* pszStr, ...)
     {
-        const int LOGLEN = 1024*50;
-        static char *pszData = NULL;
-        if ( pszData == NULL )
-            pszData = new char[LOGLEN];
-        else
-            memset(pszData, 0, LOGLEN);
+        const int LOGLEN = 1024*100;
+        static char pszData[LOGLEN] = {0};
+        memset(pszData, 0, LOGLEN);
 #if _MSC_VER >= 1200 && _MSC_VER < 1500
         sprintf(pszData, _T("[%s %s]\t"), _T("TCL"), CTime::GetCurrentTime().Format(_T("%H:%M:%S")));
 #elif _MSC_VER >= 1500