[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: suggesting some small changes with huge speed impact
From: |
Richard Frith-Macdonald |
Subject: |
Re: suggesting some small changes with huge speed impact |
Date: |
Fri, 1 Jun 2001 16:32:54 +0100 |
On Friday, June 1, 2001, at 03:26 PM, Guenther Fuerthaller wrote:
>NSMutableData already inherits a deallocation method which does a
check >to see if its data is zero, so this would not help.
off course this helps because I override the inherited method and avoid
the call to NSZoneFromPointer at all by using the existing instance
variable. The inherited implementation will thus do nothing...
I think you misunderstand ... You said ...
In NSData.m I suggest to add the following
method to the class NSMutableDataMalloc:
- (void) dealloc
{
if (bytes != 0)
{
NSZoneFree(zone, bytes);
bytes = 0;
}
[super dealloc];
}
The dealloc method inherited by NSMutableDataMalloc already looks like
the method above.