Sridar,
There is no good way for you to do this. Even if you were to get the current
stack pointer and the low-end address of the stack and call "memset (stackLow,
0, curStackPtr - stackLow)" with those values, there's nothing that says that
the values will stay set to zero. An interrupt could occur at any time, using
up some of the unused portion of the stack, setting part of that range to
non-zero values. Even calling subroutines and returning to the caller will do
this.
Why do you want to do this anyway? I can't think of any good reason for doing
so. In fact, one day, the emulator may check for accesses to the unused portion
of the stack and flag them as errors.
-- Keith Rollin
-- Palm OS Emulator engineer
"Sridhar Lanka" <[EMAIL PROTECTED]> on 12/26/2000 12:29:01 AM
Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent by: "Sridhar Lanka" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
cc: (Keith Rollin/US/PALM)
Subject: How to clear Stack Programatically
Hi All,
Is there any way I can clear my emulator stack programatically. I am
able to use SysGetStackInfo() to know whether the stack is full or not.
I just want to know if I want to clear the stack what's the best way
of doing it.
Sridhar Lanka
Sr. S/W Engineer
Avantel Softech Limited
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/