Re: suggesting some small changes with huge speed impact
From:
Guenther Fuerthaller
Subject:
Re: suggesting some small changes with huge speed impact
Date:
Fri, 1 Jun 2001 17:42:20 +0200
>The dealloc method inherited by NSMutableDataMalloc already looks like
>the method above.
except that my version makes use of the instance variable zone
(not existing in NSDataMalloc) and thus avoids the call to
NSZoneFromPointer which might be an expensive operation if
there are multiple zones.
Beginn der weitergeleiteten Mitteilung:
Date: Fri, 1 Jun 2001 16:32:54 +0100
From: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Subject: Re: suggesting some small changes with huge speed impact
Cc: GNUstep Discussion List <discuss-gnustep@gnu.org>
To: Guenther.Fuerthaller@onevision.de
X-Mailer: Apple Mail (2.388)
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.