|
![](/i/fill.gif) |
Orchid XP v8 <voi### [at] dev null> wrote:
> On 12/10/2010 04:41 PM, Warp wrote:
> > Invisible<voi### [at] dev null> wrote:
> >> I doubt we'll be seeing sophisticated cooperation schemes any time soon,
> >> but I wonder how long it will be before the OS gains the ability to
> >> notify an application that it should release some memory is possible?
> >
> > If an iPhone app is running out of memory, it will get a notification.
> Mmm, that's interesting.
> Then again, I presume the iPhone is fairly constrained for memory, so
> it's probably quite important to be able to do that kind of thing.
In fact, the entire Cocoa Touch library (which is the basic highest-level
GUI library you use to create iPhone apps and simple games) is designed
heavily around the concept of loading things lazily, unloading unused
things automatically (on receiving a memory warning) and reloading them
transparently when they are needed again (well, as transparently as you
can in Objective C). If an app is designed to fully utilize these Cocoa
Touch design principles, it often doesn't need to explicitly free things
because the library will do it automatically, but you can hook to the
low memory warning notification to free things you have allocated yourself.
(Of course all this requires that you follow a more or less strict
coding practices standard, as Objective C itself offers little in the
way of automation, unlike eg. C++ or many other higher-level languages
would.)
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |