gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDebug.m: Small extension for allocation debugging


From: Roland Schwingel
Subject: NSDebug.m: Small extension for allocation debugging
Date: Fri, 01 Aug 2003 11:04:29 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

Hi...

This patch hangs around for quite a while now adding a new function to NSDebug.m allowing to set own functioncallbacks permitting to write own debugallocation code for tracking down memleaks... It is especially useful when working on windows when using gnustep als dll, where you have no other chance to set own functions (except you would do really ugly things)...

This patch supplies a new function (taken from .m file):
/**
* This functions allows to set own function backcalls for debugging allocation
* of objects. Useful if you intend to write your own objectalloc.
*/
void
GSSetDebugAllocationFunctions(void (*newAddObjectFunc)(Class c, id o),void (*newRemoveObjectFunc)(Class c, id o))

So whenever an object is allocated or deallocated these supplied functions get called instead of the default onces. If you supply NULL for both parameters the default GNUstep functions for this task are enabled again... This is well tested and runs for quite a while now here...

Roland

Attachment: NSDebug_patch.tar.bz2
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]