In my MFC application, I am trying to allocate memory like this:
short* pLeftoversFromPrevIteration = 0;
pLeftoversFromPrevIteration = new short[chunkSize];
I am getting a "Debug Error": Invalid allocation size: 4294967295 bytes.
But in the debugger I can see that chunkSize is 4294889547 bytes which is valid.
Though if I go deeper via Call Stack, I can see:
> Book.exe!operator new(unsigned int nSize=4294967295, const char * lpszFileName=0x00a43d54, int nLine=1618) Line 67 + 0x13 bytes C++
Could you please explain this to me?