Mail Archives: djgpp/1997/11/05/16:01:18
Hi!
It is now clear how to check free stack space:
Eli Zaretskii wrote:
>Here's one version of `_stackavail' function:
>
>static __inline__ int _stackavail(void)
>{
> extern unsigned __djgpp_stack_limit;
> unsigned sp;
> __asm__ __volatile__ ("movl %%esp,%k0\n" : "=r" (sp) : );
> return (int)(sp - __djgpp_stack_limit);
>}
Thank you! Its better than nothing.
Meanwhile I contacted a person who reported similar problem
(about mmap() )
as me and have not found solution to it yet.
As he stated, sometimes, stack-availability checks are inacceptable due to
their inefficiency and are trusted to the hardware.
HOWEVER:
My posting about Fighting Gen.Prot.Faults
was addressing the question is there any mechanism
in DJGPP to intercept GPEs, caused by stack overflow ?
It seems, there is not any...
Possibly, existing DPMIs are not permitting to
intercept GPF of stack frame.
I think, this GPF interception question could be important to people,
writing interpreters and stack-greedy real-time applications.
So, if someone can enlighten us on the topic,
you are welcome!
Roman.
--
-- * --
-- Roman A. Suzi * Petrozavodsk Karelia Russia --
-- http://sampo.karelia.ru/~rnd --
- Raw text -