J
Jochen Kalmbach [MVP]
Hi roni!
You can it use *only* for unmanaged stuff.
Normally not.
In this special case: Yes
In other cases where you do not allocate "char", you have to calculate
the size.
This option is only for all allocations, which was done via the CRT; and
therefor it can only catch unmanaged allocations.
See: _CrtSetDbgFlag
http://msdn.microsoft.com/library/en-us/vclib/html/_CRT__CrtSetDbgFlag.asp
See: _CrtCheckMemory
http://msdn.microsoft.com/library/en-us/vclib/html/_crt__crtcheckmemory.asp
--
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/
i have bug in my application that using managed c++ and unmanged dll (also
vb.net involved).
my question is about malloc , can i use malloc in the unmanaged part ?
You can it use *only* for unmanaged stuff.
i just want to know if malloc can cause some bug.
Normally not.
can i replace
malloc(1000); with _nogc new char[1000]; // i get the same size of
memory allocation ?
In this special case: Yes
In other cases where you do not allocate "char", you have to calculate
the size.
one more thing about catching bug when unmanaged memory allocation involved,
i saw somthing about using _CrtSetDbgFlag() _CrtCheckMemory() ,
this functions can help me find bug about data corruption in
unmanaged\managed app ?
This option is only for all allocations, which was done via the CRT; and
therefor it can only catch unmanaged allocations.
if yes, maybe someone have links to read how to use this functions.
See: _CrtSetDbgFlag
http://msdn.microsoft.com/library/en-us/vclib/html/_CRT__CrtSetDbgFlag.asp
See: _CrtCheckMemory
http://msdn.microsoft.com/library/en-us/vclib/html/_crt__crtcheckmemory.asp
--
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/