Ben Combee wrote:

At 09:30 AM 7/29/2004, you wrote:

>Yes. When you pass a pointer to SysUIAppSwitch, you've given control of it
>to the OS, and the OS is responsible for deallocating it. That's why it's
>important to set the owner to 0 -- otherwise, the system routine that frees
>all of the memory allocated by a program when it ends would free this block
>before the new program is called.


Yes. Other than using MemPtrSetOwner(ptr, 0), is there any other way to disable the OS from freeing the memory allocated by a program when it ends?


No. This memory free is done as a standard part of the OS's application-switch code.

Thank you.

Thinking in another direction, is it possible to use owner ID of zero in
an application? Then an application simply needs to switch to use the
owner ID zero, before allocating memories which should persist after the
application quits.

I am searching for the solution, since I have cases that I do not have
access to the internal of the structure, but I want to persist them when
the application quits, such as the SslContext.

Anyone? Thank you.

Tony

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to