More optimisation.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10050 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-06-01 15:51:34 +00:00
parent d4d9022b03
commit ebba65ddcb
2 changed files with 15 additions and 3 deletions

View file

@ -1,8 +1,10 @@
2001-06-01 Richard Frith-Macdonald <rfm@gnu.uk>
Optimisations suggested by Guenther Fuerthaller
* Source/NSZone.m: NSZonefromPointer() check for empty zones
list before locking ... optimisation suggested by
Guenther Fuerthaller
list before locking.
* Source/NSData.m: more efficient dealloc implementation for
NSMutableDataMalloc.
2001-06-01 Nicola Pero <nicola@brainstorm.co.uk>

View file

@ -2554,6 +2554,16 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
initWithBytes: bytes length: length];
}
- (void) dealloc
{
if (bytes != 0)
{
NSZoneFree(zone, bytes);
bytes = 0;
}
[super dealloc];
}
- (id) initWithBytes: (const void*)aBuffer length: (unsigned)bufferSize
{
self = [self initWithCapacity: bufferSize];
@ -3082,7 +3092,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
- (void) dealloc
{
if (bytes)
if (bytes != 0)
{
struct shmid_ds buf;