• 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
Re: Accessing buffers in NSData/NSMutableData under garbage collection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing buffers in NSData/NSMutableData under garbage collection


  • Subject: Re: Accessing buffers in NSData/NSMutableData under garbage collection
  • From: Chris Suter <email@hidden>
  • Date: Wed, 20 Feb 2008 05:38:51 +1100


On 19/02/2008, at 10:48 PM, Alastair Houghton wrote:

I'm not sure what the best fix is for this. Like Chris said, one option would be to allow us to allocate "autoreleased" memory (in which case -UTF8String should probably be doing that too). Or maybe the GC should support interior pointers to memory allocated with NSAllocateCollectable()?

I'm not convinced that supporting interior pointers is the right solution. I can imagine a situation where the pointer that's lying around is pointing beyond the end of the array. For example, with optimisations this might break:


for (n = 0, myPointer = myArray; n < size; ++n, ++myPointer) {
  // Do something
}

// In the following the compiler could optimise this to be myPointer[-1]
doSomethingWith (myArray[size - 1]);
// No further references to myArray

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Accessing buffers in NSData/NSMutableData under garbage collection (From: Rick Hoge <email@hidden>)
 >Re: Accessing buffers in NSData/NSMutableData under garbage collection (From: Adam P Jenkins <email@hidden>)
 >Re: Accessing buffers in NSData/NSMutableData under garbage collection (From: mmalc crawford <email@hidden>)
 >Re: Accessing buffers in NSData/NSMutableData under garbage collection (From: Adam P Jenkins <email@hidden>)
 >Re: Accessing buffers in NSData/NSMutableData under garbage collection (From: Adam P Jenkins <email@hidden>)
 >Re: Accessing buffers in NSData/NSMutableData under garbage collection (From: Chris Suter <email@hidden>)
 >Re: Accessing buffers in NSData/NSMutableData under garbage collection (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: Accessing buffers in NSData/NSMutableData under garbage collection
  • Next by Date: Re: Accessing buffers in NSData/NSMutableData under garbage collection
  • Previous by thread: Re: Accessing buffers in NSData/NSMutableData under garbage collection
  • Next by thread: Re: Accessing buffers in NSData/NSMutableData under garbage collection
  • Index(es):
    • Date
    • Thread