Skip to main content
gamedev.net
🔒 Locked

Alloc

Started by CastorX 1 reply 550+ views
Original Post
CastorX
CastorX
Hy! I tried to cretate an arry with new operator like this: SIZE = 54; Something->Path = new WCHAR[SIZE]; The length of the path was 53. By SIZE = 512 anything was ok. But crashed. That line occured an error in debug mode (at that line), but, only in debug mode. (malloc.c)... "Bad memory allocation"...NTdll.dll and ect... If I tried to run in release mode anything was OK. (WinXP SP2, VisualStudio2005 Standard Ed.) What's wrong?
bubu LV
bubu LV
What is Something->Path?
And what did you mean by "length of the path was 53"?
Evil Steve
Evil Steve
Sounds like you've trampled over memory somewhere (Written past the end of a buffer), and that's causing malloc to fail (new uses malloc internally) on larger allocations.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.