• 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: how to make a task less cpu intensive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to make a task less cpu intensive


  • Subject: Re: how to make a task less cpu intensive
  • From: Paul Scott <email@hidden>
  • Date: Fri, 28 Dec 2012 11:02:35 -0800

For clarification: Allocate enough for your total allocations, or some good estimate, using malloc_create_zone(), then make your allocations with malloc_zone_malloc(), and finally, destroy the zone in one fell swoop with malloc_destroy_zone(). This should avoid the overhead of all those free()'s.

Paul

On Dec 28, 2012, at 10:56 AM, Paul Scott <email@hidden> wrote:

> Try using a memory zone, see malloc_zone_malloc (3) and http://jeny.us/vXc3 (short link to Apple developer page describing malloc_zone_malloc, etc).
>
> Paul
>
> On Dec 28, 2012, at 9:40 AM, Nick Rogers <email@hidden> wrote:
>
>> Hi,
>>
>> I have a tree in memory (all nodes malloc'ed blocks) and when I start freeing this large tree, I traverse the tree and free all nodes.
>> This becomes cpu intensive and so the progress bar on my sheet doesn't animate.
>>
>> In similar other situations the progress bar animates, when different code is executed in the background.
>>
>> Any ideas on how to make tree freeing process less intensive?
>>
>> Thanks,
>> Nick
>
> _______________________________________________
>
> 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


_______________________________________________

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

References: 
 >how to make a task less cpu intensive (From: Nick Rogers <email@hidden>)
 >Re: how to make a task less cpu intensive (From: Paul Scott <email@hidden>)

  • Prev by Date: Re: how to make a task less cpu intensive
  • Next by Date: Re: Bound NSTextField displays Selection Placeholder instead of Null Placeholder
  • Previous by thread: Re: how to make a task less cpu intensive
  • Next by thread: Re: how to make a task less cpu intensive
  • Index(es):
    • Date
    • Thread