-// m_pMem = new unsigned char[nTargetSize];
-m_pMem = new (nothrow) unsigned char[nTargetSize];
-while (m_pMem == NULL && nTargetSize >= 512 * 1024 * 1024 )
-{
- nTargetSize -= 16 * 1024 * 1024;
- m_pMem = new (nothrow) unsigned char[nTargetSize];
-}
- if (m_pMem != NULL)
- {
+ // m_pMem = new unsigned char[nTargetSize];
+#ifdef _MEMORYDEBUG
+ printf("Allocating %i bytes of memory - ", nTargetSize);
+#endif
+
+ m_pMem = new (nothrow) unsigned char[nTargetSize];
+ while (m_pMem == NULL && nTargetSize >= 512 * 1024 * 1024 ) {
+#ifdef _MEMORYDEBUG
+ printf("failed!\n");
+ printf("Allocating %i bytes of memory (backup) - ", nTargetSize);
+#endif
+ nTargetSize -= 16 * 1024 * 1024;
+ m_pMem = new (nothrow) unsigned char[nTargetSize];
+ }
+ if (m_pMem != NULL) {
+#ifdef _MEMORYDEBUG
+ printf("success!\n");
+#endif