• 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: memcpy with 64 bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memcpy with 64 bit


  • Subject: Re: memcpy with 64 bit
  • From: Clark Cox <email@hidden>
  • Date: Tue, 15 Dec 2009 07:27:41 -0800

On Tue, Dec 15, 2009 at 6:33 AM, gMail.com <email@hidden> wrote:
> Thanks,
> I have just read that doc
> http://developer.apple.com/mac/library/documentation/Performance/Conceptual/
> ManagingMemory/Articles/MemoryAlloc.html
>
> So it seems I can really calloc e.g. 60MB with calloc. Can you confirm?

Yes, why wouldn't you be able to?

> If not, I could use NSMutableData. If so, could I get the pointer with this?
>    imageBase = [data bytes];

You would want to use [data mutableBytes].

> If I use calloc, then when I call free(ptr) does the memory get release
> immediately?

Yes.

> Or does it behave as I call [data release];   ?
>
> --
> Leo
>
>> Da: Ken Thomases <email@hidden>
>> Data: Tue, 15 Dec 2009 04:50:07 -0600
>> A: "gMail.com" <email@hidden>
>> Cc: <email@hidden>
>> Oggetto: Re: memcpy with 64 bit
>>
>> On Dec 15, 2009, at 2:50 AM, gMail.com wrote:
>>
>>>> Da: Andrew Farmer <email@hidden>
>>>> Data: Mon, 14 Dec 2009 20:17:41 -0800
>>>>
>>>> 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.
>>>
>>> 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?
>>
>> There's no good reason why it has to be a handle.  Use an
>> NSMutableData or even just malloc a chunk of the heap.
>>
>> Handles have an unnecessary level of indirection.  Back in the day,
>> that came with relocatability, but it doesn't anymore.  It's just
>> obscure and excessively complicated.
>>
>> Regards,
>> Ken
>>
>
>
> _______________________________________________
>
> 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
>



--
Clark S. Cox III
email@hidden
_______________________________________________

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

  • Follow-Ups:
    • Re: memcpy with 64 bit
      • From: "gMail.com" <email@hidden>
References: 
 >Re: memcpy with 64 bit (From: Ken Thomases <email@hidden>)
 >Re: memcpy with 64 bit (From: "gMail.com" <email@hidden>)

  • Prev by Date: Help Debugging NSPredicateEditor reloadCriteria Exception
  • Next by Date: Re: Core Data Save As Binary Error
  • Previous by thread: Re: memcpy with 64 bit
  • Next by thread: Re: memcpy with 64 bit
  • Index(es):
    • Date
    • Thread