DSPRelated.com
Forums

Allocating memory from the stack

Started by Laurent August 9, 2006
Hi,

Is there a way to easily allocate memory from the stack ? I am trying
to do so with SHARC 21369, but there is no alloca() function.
Maybe there is an alternative ?

Thanks,
Laurent
On Tuesday 08 August 2006 22:20, Laurent wrote:
> Hi,
>
> Is there a way to easily allocate memory from the stack ? I am trying
> to do so with SHARC 21369, but there is no alloca() function.
> Maybe there is an alternative ?
>
> Thanks,
> Laurent
>

Modify the stack management variables manually??
Since i7,m7 are used to manage the stack, this should be easy as long as
you want to allocate the variables only until the current subroutine leaves.
Just modify i7 and you have allocated the space between old and new value.
And restore i7 before returning from the subroutine.

It's more difficult if you want the allocation to live longer than the
subroutine...

Bernhard

----
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
Ueber das Internet versandte E-Mails koennen leicht unter fremden Namen
erstellt oder manipuliert werden. Aus diesem Grunde bitten wir um
Verstaendnis, dass wir zu Ihrem und unserem Schutz die rechtliche
Verbindlichkeit der vorstehenden Erklaerungen und Aeusserungen
ausschliessen.

This E-mail may contain confidential and/or privileged information. If
you are not the intended recipient or have received this E-mail in
error, please notify the sender immediately and destroy this E-mail. Any
unauthorized copying, disclosure or distribution of the material in this
E-mail is strictly forbidden.
E-mails via Internet can easily be prepared or manipulated by third
persons. For this reason we trust you will understand that, for your own
and our protection, we rule out the legal validity of the foregoing
statements and comments.