[Biococoa-dev] NSMutableData vs malloc

Spam Eater at BiO spam at bioinformatics.org
Fri Jul 8 22:52:51 EDT 2005


Caught in filters.
----------------------

On 6-jul-2005, at 23:54, Koen van der Drift wrote:

> On Jul 6, 2005, at 3:15 PM, John Timmer wrote:
>
>> I'm all for NSData, since I know how to use that ;).  Next question - 
>> we're
>> already using unichar's, which are 2 bytes - is that what we intend 
>> to stuff
>> in the data, or should we think of recasting to unsigned chars?  The 
>> second
>> would probably greatly increase the efficiency of the code and make a lot
>> more C code available to us, but we'd need to revamp a bunch of the 
>> classes.
>>
>>
>
> My preference would be to use the (unsigned) chars.


Yes, I couldn't agree more with Koen. One of the nice things of our new 
approach would be the ability to use common implementations and 
algorithms on the char array (encapsulated via NSData), and have less 
(4x less) ram/storage needed as if we would use pointers. If we now 
would start to use 2bytes unichars, first we would double the amount of 
space needed, and more important still have to do (a lot?) of 
adjustments to make it work with existing implementations. And given the 
fact that we don't have alphabets larger than 128 characters anyway (I 
presume), why would like to use unichars specifically?
Alex


********************************************************* 

                    ** Alexander Griekspoor **

********************************************************* 

             The Netherlands Cancer Institute

             Department of Tumorbiology (H4)

        Plesmanlaan 121, 1066 CX, Amsterdam

                   Tel:  + 31 20 - 512 2023

                   Fax:  + 31 20 - 512 2029

                   AIM: mekentosj at mac.com <mailto:mekentosj at mac.com>

                   E-mail: a.griekspoor at nki.nl <mailto:a.griekspoor at nki.nl>

               Web: http://www.mekentosj.com

 

      Microsoft is not the answer,

      Microsoft is the question,

      NO is the answer


*********************************************************






More information about the Biococoa-dev mailing list