• 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: Ondra Cada <email@hidden>
  • Date: Tue, 19 Mar 2002 18:21:33 +0100

On Tuesday, March 19, 2002, at 04:42 , Don Rainwater wrote:

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];

right, it's even better. Though as rarely needed in practice that it is no thing to be shown to newbies ;)

For experienced programmers this can sometimes come handy, just like the alternative non-pool approach of

id foo=nil;
NS_DURING
[[Foo alloc] init];
...
...
NS_HANDLER
...
NS_ENDHANDLER
[foo release];
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.

References: 
 >Re: Newbie with stupid question cont. (From: Don Rainwater <email@hidden>)

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