Click here to Skip to main content
15,913,722 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalproblems in dynamic Memory allocation Pin
Amit Mulay9-Jun-05 0:32
Amit Mulay9-Jun-05 0:32 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 1:07
James R. Twine9-Jun-05 1:07 
GeneralRe: problems in dynamic Memory allocation Pin
Amit Mulay9-Jun-05 1:47
Amit Mulay9-Jun-05 1:47 
GeneralRe: problems in dynamic Memory allocation Pin
Amit Mulay9-Jun-05 1:58
Amit Mulay9-Jun-05 1:58 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 4:38
James R. Twine9-Jun-05 4:38 
GeneralRe: problems in dynamic Memory allocation Pin
Amit Mulay9-Jun-05 2:12
Amit Mulay9-Jun-05 2:12 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 4:25
James R. Twine9-Jun-05 4:25 
GeneralRe: problems in dynamic Memory allocation Pin
Tim Smith9-Jun-05 3:50
Tim Smith9-Jun-05 3:50 
Malloc or new doesn't fail unless your system is out of memory (which I doubt).

There are two things that can be going on:

1. Prior to allocating the memory, you have managed to trash your memory heap thus causing the call to fail. Try using _CrtCheckMemory before and after the call to malloc.
2. The malloc is actually working just fine, but due to other bugs in your code, the routine is failing and you are misdiagnosing the problem as an allocation failure. I see this happen very often. Usually by people who can't believe their software has bugs so they blame the compiler. However, experienced programmers do this to.

Tim Smith

I'm going to patent thought. I have yet to see any prior art.
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 4:26
James R. Twine9-Jun-05 4:26 
GeneralRe: problems in dynamic Memory allocation Pin
Alexander M.,9-Jun-05 5:46
Alexander M.,9-Jun-05 5:46 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 5:56
James R. Twine9-Jun-05 5:56 
Generalstd::map problem Pin
Bob Stanneveld8-Jun-05 23:34
Bob Stanneveld8-Jun-05 23:34 
GeneralDoh! Pin
Bob Stanneveld9-Jun-05 0:20
Bob Stanneveld9-Jun-05 0:20 
GeneralRe: std::map problem Pin
Nilesh K.9-Jun-05 0:21
Nilesh K.9-Jun-05 0:21 
GeneralRe: std::map problem Pin
Bob Stanneveld9-Jun-05 0:26
Bob Stanneveld9-Jun-05 0:26 
GeneralRe: std::map problem Pin
grasstafari9-Jun-05 0:25
grasstafari9-Jun-05 0:25 
GeneralPOST string to .asp Pin
dex_ter118-Jun-05 23:24
dex_ter118-Jun-05 23:24 
GeneralRe: POST string to .asp Pin
Bob Stanneveld8-Jun-05 23:54
Bob Stanneveld8-Jun-05 23:54 
GeneralRe: POST string to .asp Pin
ThatsAlok9-Jun-05 1:05
ThatsAlok9-Jun-05 1:05 
GeneralRe: POST string to .asp Pin
dex_ter119-Jun-05 15:16
dex_ter119-Jun-05 15:16 
GeneralRe: POST string to .asp Pin
ThatsAlok9-Jun-05 18:21
ThatsAlok9-Jun-05 18:21 
GeneralLNK2001 Error Using Edit Control Variable in static function Pin
CNewbie8-Jun-05 23:03
CNewbie8-Jun-05 23:03 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
GDavy8-Jun-05 23:19
GDavy8-Jun-05 23:19 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
Bob Stanneveld9-Jun-05 0:03
Bob Stanneveld9-Jun-05 0:03 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
CNewbie9-Jun-05 0:45
CNewbie9-Jun-05 0:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.