• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSZoneRealloc bug ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Drawing an NSImage into a custom NSView
  • Next by Date: Re: Drawing an NSImage into a custom NSView
  • Previous by thread: Customizing NSSavePanel behavior
  • Next by thread: Quartz graphics context TO QuickDraw graphics port ?
  • Index(es):
    • Date
    • Thread