Forums

6711 DSK Memory Question

Started by Dave F June 24, 2003
Hi,

I have a piece of real time speech enhancement software running and i want
to store a few minutes of the in and out buffers on memory.  What is the
safest recommended way of allocating a large chunk of memory using Code
Composer Studio that wont smash my stack all to bits or cause other
problems. Basically what i want to do is:

#define BUFFERSIZE_BYTES 1000000

char in_buff[BUFFERSIZE_BYTES];
char out_buff[BUFFERSIZE_BYTES];
....

Whats the best way?
On Tue, 24 Jun 2003 20:58:44 GMT, Dave F <no@spam.com> wrote:

>Hi, > >I have a piece of real time speech enhancement software running and i want >to store a few minutes of the in and out buffers on memory. What is the >safest recommended way of allocating a large chunk of memory using Code >Composer Studio that wont smash my stack all to bits or cause other >problems. Basically what i want to do is: > >#define BUFFERSIZE_BYTES 1000000 > >char in_buff[BUFFERSIZE_BYTES]; >char out_buff[BUFFERSIZE_BYTES]; >.... > >Whats the best way?
As long as you make those buffers global (static) you shouldn't have too much of a problem. Stack will be a problem if you try to allocate them within a function (i.e. on a stack frame). The alternative is to use something like malloc() which will allocate them on the heap, but your heap would need to be configured then as wll to make sure it was big enough. That's not difficult, but... Best Regards John McCabe To reply by email replace 'nospam' with 'assen'