mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Memory leak fixes and a little new debug functionality
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17803 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c019ce0f9e
commit
2c18a5ea43
6 changed files with 160 additions and 21 deletions
|
@ -132,6 +132,16 @@ GS_EXPORT void GSDebugAllocationActiveRecordingObjects(Class c);
|
|||
*/
|
||||
GS_EXPORT NSArray *GSDebugAllocationListRecordedObjects(Class c);
|
||||
|
||||
/**
|
||||
* This function associates the supplied tag with a recorded
|
||||
* object and returns the tag which was previously associated
|
||||
* with it (if any).<br />
|
||||
* If the object was not recorded, the method reurns nil<br />
|
||||
* The tag is retained while it is associated with the object.<br />
|
||||
* See also the NSDebugFRLog() and NSDebugMRLog() macros.
|
||||
*/
|
||||
GS_EXPORT id GSDebugAllocationTagRecordedObject(id object, id tag);
|
||||
|
||||
/**
|
||||
* Used to produce a format string for logging a message with function
|
||||
* location details.
|
||||
|
@ -288,6 +298,29 @@ GS_EXPORT BOOL NSDeallocateZombies;
|
|||
NSString *fmt = GSDebugMethodMsg( \
|
||||
self, _cmd, __FILE__, __LINE__, format); \
|
||||
NSLog(fmt , ## args); }} while (0)
|
||||
|
||||
/**
|
||||
* This macro saves the name and location of the function in
|
||||
* which the macro is used, along with a short string msg as
|
||||
* the tag associated with a recorded object.
|
||||
*/
|
||||
#define NSDebugFRLog(object, msg) \
|
||||
do { \
|
||||
NSString *tag = GSDebugFunctionMsg( \
|
||||
__PRETTY_FUNCTION__, __FILE__, __LINE__, msg); \
|
||||
GSDebugAllocationTagRecordedObject(object, tag); } while (0)
|
||||
|
||||
/**
|
||||
* This macro saves the name and location of the method in
|
||||
* which the macro is used, along with a short string msg as
|
||||
* the tag associated with a recorded object.
|
||||
*/
|
||||
#define NSDebugMRLog(object, msg) \
|
||||
do { \
|
||||
NSString *tag = GSDebugMethodMsg( \
|
||||
self, _cmd, __FILE__, __LINE__, msg); \
|
||||
GSDebugAllocationTagRecordedObject(object, tag); } while (0)
|
||||
|
||||
#else
|
||||
#define NSDebugLLog(level, format, args...)
|
||||
#define NSDebugLog(format, args...)
|
||||
|
@ -295,6 +328,8 @@ GS_EXPORT BOOL NSDeallocateZombies;
|
|||
#define NSDebugFLog(format, args...)
|
||||
#define NSDebugMLLog(level, format, args...)
|
||||
#define NSDebugMLog(format, args...)
|
||||
#define NSDebugFRLog(object, msg)
|
||||
#define NSDebugMRLog(object, msg)
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue