Re: Newbie with stupid question cont.
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.