malloc/calloc is a better way.

«Mac OS X implements a highly-tuned, threadsafe allocation library, providing 
standard implementations of the malloc,calloc, realloc, and free routines, 
among others. If you are allocating memory using older routines such as NewPtr 
or NewHandle, you should change your code to use malloc instead. The end result 
is the same since most legacy routines are now wrappers for malloc anyway.»

from 
http://developer.apple.com/mac/library/documentation/Performance/Conceptual/ManagingMemory/Articles/MemoryAlloc.html


Le 15 déc. 2009 à 09:50, gMail.com a écrit :

> Ouch! That's my old code. But it works on
> 64-bit Intel, Base SDK 10.6, x86_64, GCC 4.2, Target Mac OS X 10.6
> I need an handle to store image bitmap data for later reuse by the OpenGL
> API  "glTexImage2D". Do you know a better way?
> 
> --
> Leonardo
> 
>> Da: Andrew Farmer <[email protected]>
>> Data: Mon, 14 Dec 2009 20:17:41 -0800
>> A: "gMail.com" <[email protected]>
>> Cc: <[email protected]>
>> Oggetto: Re: memcpy with 64 bit
>> 
>> On 14 Dec 2009, at 11:06, gMail.com wrote:
>>> Handle           imagesH = NewHandleClear(totImages * oneImageSize);
>> 
>> Wait, Handle? NewHandleClear? Your use of these functions suggests that you
>> may be working from a dangerously old textbook. There's really no reason to
>> use them in new code.
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org
> 
> This email sent to [email protected]
> 

-- Jean-Daniel




_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to