No class names for objects created using operator new[]
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2010
02:12 AM
05-28-2010
02:12 AM
No class names for objects created using operator new[]
I'm using the allocation profiler and hit a snag. I switched the container for one of my most allocated class from an stl vector to a standard array created with operator new[]. After doing so, the class name no longer shows any memory allocations in the results panel (either objects or classes). Instead, it's lumped in with C++ native memory and is therefore nearly impossible to track. What's even more odd is that if I allocate a single object it is tracked. For example:
CMyClass* pArray = new CMyClass[1000]; // not tracked
CMyClass* pOne = new CMyClass; // works fine!
Any ideas?
CMyClass* pArray = new CMyClass[1000]; // not tracked
CMyClass* pOne = new CMyClass; // works fine!
Any ideas?
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2010
11:25 PM
06-03-2010
11:25 PM
Hi Michael,
We failed to reproduce this behavior with AQtime 6.50. Here is the code of a sample application I used:
#include "stdafx.h"
#include "windows.h"
class CTest
{
private:
BYTE data[32768];
public:
void FillData() {data[0] = 0x00;}
CTest() {};
};
int _tmain(int argc, _TCHAR* argv[])
{
CTest* pArray = new CTest[256];
CTest* myObj = new CTest();
pArray[0].FillData();
return 0;
}
Please let me know whether you can reproduce the problem with this sample. If you cannot, could you please send me your sample demonstrating the problem? You can send it directly via the Contact Support form.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
