Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDrawDragRect Help Pin
poiut17-Dec-04 5:55
poiut17-Dec-04 5:55 
GeneralRe: DrawDragRect Help Pin
Anonymous20-Dec-04 5:23
Anonymous20-Dec-04 5:23 
GeneralDoModal message loops Pin
christopheredill17-Dec-04 5:44
christopheredill17-Dec-04 5:44 
Generalcaveats when using _malloc_dbg Pin
Maximilien17-Dec-04 5:39
Maximilien17-Dec-04 5:39 
GeneralRe: caveats when using _malloc_dbg Pin
Bo Hunter17-Dec-04 12:03
Bo Hunter17-Dec-04 12:03 
GeneralRe: caveats when using _malloc_dbg Pin
peterchen17-Dec-04 22:09
peterchen17-Dec-04 22:09 
GeneralRe: caveats when using _malloc_dbg Pin
ThatsAlok17-Dec-04 22:39
ThatsAlok17-Dec-04 22:39 
GeneralRe: caveats when using _malloc_dbg Pin
peterchen17-Dec-04 23:09
peterchen17-Dec-04 23:09 
No need for the Sir, Sir Smile | :)


malloc_dbg calls malloc, but requests a few more bytes. These bytes are filled with a predefined value. free_dbg then checks if these extra bytes still hold this value. If they did, you probably wrote beyond the allocated memory (The VC Runtime prints a diagnostic message to the debug output)

Typical implementations add 4 bytes at the end. In this case, using free instead of _free_dbg is often not a problem, but depending on the implementation, it might leak the guard bytes.

But if an implementation adds guard bytes *before* the memory provided to you (to detect underflows, which are less common), using free instead of -free_dbg is likely to corrupt the heap.




we are here to help each other get through this thing, whatever it is Vonnegut jr.
boost your code || Fold With Us! || sighist | doxygen

GeneralRe: caveats when using _malloc_dbg Pin
ThatsAlok18-Dec-04 0:01
ThatsAlok18-Dec-04 0:01 
GeneralAlt+Tab replacement Pin
User 665817-Dec-04 4:50
User 665817-Dec-04 4:50 
GeneralRe: Alt+Tab replacement Pin
Alex Korchemniy17-Dec-04 13:14
Alex Korchemniy17-Dec-04 13:14 
GeneralRe: Alt+Tab replacement Pin
User 665817-Dec-04 14:29
User 665817-Dec-04 14:29 
GeneralRe: Howto update text files Pin
yarp17-Dec-04 3:57
yarp17-Dec-04 3:57 
GeneralRe: Howto update text files Pin
John R. Shaw17-Dec-04 4:59
John R. Shaw17-Dec-04 4:59 
GeneralHowto update text files Pin
yarp17-Dec-04 3:28
yarp17-Dec-04 3:28 
GeneralRe: Howto update text files Pin
Prakash Nadar17-Dec-04 3:46
Prakash Nadar17-Dec-04 3:46 
GeneralWhen "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 2:32
Member 159648417-Dec-04 2:32 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 4:19
John R. Shaw17-Dec-04 4:19 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 4:37
Member 159648417-Dec-04 4:37 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 4:46
John R. Shaw17-Dec-04 4:46 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 12:57
Member 159648417-Dec-04 12:57 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 14:06
John R. Shaw17-Dec-04 14:06 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
Antony M Kancidrowski17-Dec-04 4:53
Antony M Kancidrowski17-Dec-04 4:53 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 5:44
John R. Shaw17-Dec-04 5:44 
GeneralRe: When "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
Anonymous17-Dec-04 6:52
Anonymous17-Dec-04 6:52 

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.