Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Allocation Size

Status
Not open for further replies.

TheCrappyProgrammer

Programmer
Sep 17, 2001
41
US
Occasionally, my program gets a Debug Error saying
"Invalid allocation size: 4294967292 bytes."

Does anyone know what usually causes this?
 
You have a memory - allocation command with the size of -4, for example:
char * ptr = new char [-4];
It may be malloc(), VirtualAlloc(), HeapAlloc() etc.
-4 is converted to unsigned FFFFFFFC, and it is too many.
I think, You do not have -4 directly, but an another Function returns wrong size that is then ysed to alloc memory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top