Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bobber205

macrumors 68020
Original poster
Nov 15, 2005
2,183
8
Oregon
In Visual studio you use:

Code:
#define _CRTDBG_MAP_ALLOC

//then after main
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

This does not compile in Xcode.
Launch Using Performance Tool --> Malloc does not work b/c I am using the new operators with C++.

EDIT:

When I purposely try to go over an array's bounds, I get "executable path is nil". What does this mean?

Thanks! :D
 
In Visual studio you use:

Code:
#define _CRTDBG_MAP_ALLOC

//then after main
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

This does not compile in Xcode.
Launch Using Performance Tool --> Malloc does not work b/c I am using the new operators with C++.

EDIT:

When I purposely try to go over an array's bounds, I get "executable path is nil". What does this mean?

Thanks! :D


I am not sure what you mean by "Malloc does not work..."

malloc() almost always works if you have enough RAM to support what you are malloc-ing! Are you trying a data type conversion on what you are malloc-ing, or just asking for a chuck of memory?

Trying to create range-checking errors on purpose is not a sign of bravery... that is usually the quickest way to crash, do not "Pass Go" or collect $200, go straight to Crash City, enjoy your stay...

I work with malloc() day in and day out, so if I knew more about what you were trying to do, I might be able to help.
 
I didn't mean the Malloc function in general. ;)

I meant the Tool That's called MallocCheck or something like that. :D
 
Could I suggest that instead of asking the poor folks at MacRumors you get the information from the horses mouth?

Go to www.apple.com.
Click on "Developer"
Type "memory leak" into the search box.
 
I didn't mean the Malloc function in general. ;)

I meant the Tool That's called MallocCheck or something like that. :D

If I recall correctly, the new operator calls into malloc() at some point, so MallocCheck should still work.
 
Are you looking for Guard Malloc? To enable it, just tick "Enable Guard Malloc" at the bottom of the Debug pull-down menu in the menu bar. Then do a "Build and Debug" (i.e. command+Y) from the build menu...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.