Re: NSMutableData and Pinned Memory buffers..

2012-12-14 Thread Mike Abdullah
Arguably, you'd be better off subclassing NSData directly to add the mutation APIs that you actually need. That clears up any possible confusion about methods which might affect the length of the data. On 14 Dec 2012, at 00:13, Robert Monaghan wrote: > Thanks for the suggestion, Kevin! > > I w

Re: NSMutableData and Pinned Memory buffers..

2012-12-13 Thread Gwynne Raskind
On Dec 13, 2012, at 7:28 PM, Kevin Perry wrote: > On Dec 13, 2012, at 4:24 PM, Greg Parker wrote: >> On Dec 13, 2012, at 4:13 PM, Robert Monaghan wrote: >>> I went ahead and created a really crude subclass of NSMutableData. It seems >>> to work for my situation. >>> Attached is the code, for po

Re: NSMutableData and Pinned Memory buffers..

2012-12-13 Thread Melissa J Turner
On Dec 13, 2012, at 4:28 PM, Kevin Perry wrote: > > On Dec 13, 2012, at 4:24 PM, Greg Parker wrote: > >> On Dec 13, 2012, at 4:13 PM, Robert Monaghan wrote: >>> I went ahead and created a really crude subclass of NSMutableData. It seems >>> to work for my situation. >>> Attached is the code

Re: NSMutableData and Pinned Memory buffers..

2012-12-13 Thread Kevin Perry
On Dec 13, 2012, at 4:24 PM, Greg Parker wrote: > On Dec 13, 2012, at 4:13 PM, Robert Monaghan wrote: >> I went ahead and created a really crude subclass of NSMutableData. It seems >> to work for my situation. >> Attached is the code, for posterity. (I am sure I won't be the only one >> worki

Re: NSMutableData and Pinned Memory buffers..

2012-12-13 Thread Greg Parker
On Dec 13, 2012, at 4:13 PM, Robert Monaghan wrote: > I went ahead and created a really crude subclass of NSMutableData. It seems > to work for my situation. > Attached is the code, for posterity. (I am sure I won't be the only one > working around this.) > > Any suggestions to make this a bit

Re: NSMutableData and Pinned Memory buffers..

2012-12-13 Thread Robert Monaghan
Thanks for the suggestion, Kevin! I went ahead and created a really crude subclass of NSMutableData. It seems to work for my situation. Attached is the code, for posterity. (I am sure I won't be the only one working around this.) Any suggestions to make this a bit more "Proper" are welcome. bo

Re: NSMutableData and Pinned Memory buffers..

2012-12-13 Thread Kevin Perry
NSMutableData currently ignores (and always has, to my knowledge) the no-copy "hint" and always copies the bytes into an internal buffer in case something tries to change the length of the NSMutableData. It would not be too difficult to make a subclass of NSMutableData that doesn't copy and thr

NSMutableData and Pinned Memory buffers..

2012-12-13 Thread Robert Monaghan
Hi Everyone, I have just run head long into an issue with NSMutableData and existing buffers. I have the following code: UInt8 *sourcebytes = [clImgEngine srcBuffer]; [self setData:[NSMutableData dataWithBytesNoCopy:sourcebytes length:[clImgEngine