Re: Accessing buffers in NSData/NSMutableData under garbage collection
Re: Accessing buffers in NSData/NSMutableData under garbage collection
- Subject: Re: Accessing buffers in NSData/NSMutableData under garbage collection
- From: Adam P Jenkins <email@hidden>
- Date: Tue, 19 Feb 2008 00:23:31 -0500
On Feb 19, 2008, at 12:19 AM, Adam P Jenkins wrote:
So if you don't need your code to work in non-GC mode, then you can
just replace
float *myPointer = [[NSMutableData
dataWithLength:size*sizeof(float)] mutableBytes];
with
float *myPointer = NSAllocateCollectable(size*sizeof(float), 0);
and get the same effect.
Oops, I left out __strong, I meant the second statement to be:
__strong float *myPointer = NSAllocateCollectable(size*sizeof(float),
0);
_______________________________________________
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