• 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: AutoreleasePool mechanics
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AutoreleasePool mechanics


  • Subject: Re: AutoreleasePool mechanics
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 20 Dec 2001 17:06:45 +0100

mikevannorsdel,

>>>>>> mikevannorsdel (m) wrote at Thu, 20 Dec 2001 07:25:57 -0700:
m> That's about what I figured. What I'm really curious about is the pool
m> provided by AppKit. Is this pool automatically replaced (cleaned)? If not,
m> it would seem an application can build a big pile of objects before
m> termination. The documentation says the AppKit automatically creates and
m> destroys pools. I wonder when and how often.

I am quite positive this is documented as well (though I don't just now
remember where exactly): for each event loop a new pool is created (and
destroyed when then even loop ends). Something like

while (evt=lowLevelServiceToGetTheNextEvent()) {
id pool=[[NSAutoreleasePool alloc] init];
[NSApp sendEvent:evt];
[pool relese];
}

though the actual implementation would be naturally more complicated.

So, unless you create a big pile of objects inside one event, there's no fear.
---
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


  • Follow-Ups:
    • Re: AutoreleasePool mechanics
      • From: email@hidden (mikevannorsdel)
References: 
 >Re: AutoreleasePool mechanics (From: email@hidden (mikevannorsdel))

  • Prev by Date: Re: (OT) auto-indent a big hit here
  • Next by Date: Re: AutoreleasePool mechanics
  • Previous by thread: Re: AutoreleasePool mechanics
  • Next by thread: Re: AutoreleasePool mechanics
  • Index(es):
    • Date
    • Thread