Mon, 08 Nov 1999 Marc Wiegmann wrote:
> i have understood that there is no savely way to allocate memory
> dynamically in a RT task. But what is with the definitions of
> variables/arrays in functions. Isn't it a dyn. mem. allocation too? Or
> do you think that there are only small amounts of memory to allocate,
> which will be on hand every time.

The compiler generates code that uses the stack for that purpose. That is why
the local variables are destroyed (unless they're static, of course) when the
function returns - the stack frame is removed (ie the stack pointer is restored)
before the RET instruction.


//David


 ·A·U·D·I·A·L·I·T·Y·   P r o f e s s i o n a l   L i n u x   A u d i o
· ··---------------------------+-----------------------------------·· ·
  ·Rock Solid  ·Low Latency    | - David Olofson -     ·Audio hacker
  ·Plug-Ins    ·Open Source    :                       ·Linux advocate
www.angelfire.com/or/audiality · [EMAIL PROTECTED]  ·Singer/composer
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to