NSZoneRealloc bug ?
NSZoneRealloc bug ?
- Subject: NSZoneRealloc bug ?
- From: "Matteo Rossi" <email@hidden>
- Date: Wed, 16 Oct 2002 13:21:24 +0200
I have some problems with NSZoneRealloc.
Look at the following code
myptr = NSZonaMalloc(zone, mysize);
newptr = NSZoneRealloc(zone, myptr, newsize );
if( newptr )
myptr = newptr;
It should realloc a block of memory of a greter size and copy the content of
ptr in the new memory location.
I've found that if it's not able to allocate memory I get a sigbus 10, since
it probably doesn't check for memory really allocated and copies the content
of myptr.
According to me, if it's not able to allocate a greater memory block, it
should simply return nil and leave unchanged myptr.
Am I wrong ?
Is it a bug ?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.