What you're doing won't work, as far as I can tell.
Header:
/** Deprecated ...<br />
* Obtain statistics about the zone. Implementation emphasis is on
* correctness, not speed. Not defined by OpenStep or OS X.
*/
struct NSZoneStats
NSZoneStats (NSZone *zone);
Implementation:
static struct NSZoneStats
default_stats (NSZone *zone)
{
struct NSZoneStats dummy = {0,0,0,0,0};
/* We can't obtain statistics from the memory managed by malloc(). */
[NSException raise: NSGenericException
format: @"No statistics for default zone"];
return dummy;
}
static NSZone default_zone =
{
default_malloc, default_realloc, default_free, default_recycle,
default_check, default_lookup, default_stats, 0, @"default", 0
};
NSZone*
NSDefaultMallocZone (void)
{
return &default_zone;
}
struct NSZoneStats
NSZoneStats (NSZone *zone)
{
if (!zone)
zone = NSDefaultMallocZone();
return (zone->stats)(zone);
}