• 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: Newbie with stupid question cont.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie with stupid question cont.


  • Subject: Re: Newbie with stupid question cont.
  • From: Shawn Erickson <email@hidden>
  • Date: Tue, 19 Mar 2002 08:52:39 -0800

On Tuesday, March 19, 2002, at 07:42 AM, Don Rainwater wrote:
Seems counter-intuitive, doesn't it? You would think that the overhead involved in this approach would be expensive. Is this a memory allocation issue? Is it because the default pool is of a preset size and extending it incurs a lot of overhead, or because of overall process resource allocations, or...? For a really high loop count, would there be any benefit to something like:

NSAutoreleasePool *pool;

pool = [[NSAutoreleasePool alloc] init];
for (x = 1; x <= highLoopLimit; x++) {
if (!(x % poolLimit)) {
[pool release];
pool = [[NSAutoreleasePool alloc] init];
}
...
}
[pool release];

// where poolLimit is 100, or 1000, or some useful number less than highLoopLimit.

Or am I overthinking this?

AFAIK autorelease pools use a simple linked list of objects. So I don't think you need worry hitting a limit and incurring a reallocation of the autorelease pool collection storage.

-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Newbie with stupid question cont.
      • From: Shawn Erickson <email@hidden>
References: 
 >Re: Newbie with stupid question cont. (From: Don Rainwater <email@hidden>)

  • Prev by Date: Re: Need clarification on categories
  • Next by Date: Newbie with stupid question cont.
  • Previous by thread: Re: Newbie with stupid question cont.
  • Next by thread: Re: Newbie with stupid question cont.
  • Index(es):
    • Date
    • Thread