Storing an array

Jorge Andreu García andreu at
Mon Jun 19 11:18:53 UTC 2000

Nick.SIMON at wrote:

> > -----Original Message-----
> > From: Jorge Andreu Garca [mailto:andreu at]
> > Sent: 19 June 2000 09:11
> > To: rtems
> > Subject: Storing an array
> >
> >
> > Hello:
> >
> > I want to use an array of  120.000 integersin a program that
> > should run
> > on rtems, but I can't:
> >
> > When I store this in memory, the program stop when it read the
> > declaration line of the array.
> If your program is executing a declaration it must be an automatic, i.e. on
> the stack.  I doubt you have 480K bytes of stack space available!

How much space has the stack more or less? Can I enlarge this size?

> > When I store it in heap (with a pointer
> > in Ada) the computer reboot in the same line.
> Putting it on the heap is probably the right thing - assuming you have
> enough space in your heap.

how can I check if I have enough place?

> If you have (or should have) it could be that your heap has become
> corrupted.
> The other valid way to store a large object is as a static or global, if
> it's something thats needed continuously, or over & over again, in your
> application.

Where is stored a global array?

> >
> > Is there any function of rtems or any specification file where I can
> > change the maximum size of the variables?
> This is done in the BSP. Which are you using?

I am running my RTEMS program in a Pentium II, so I use the i386-rtems BSP

>  BTW do you really need 120
> thousand integers? It does seem a lot.

The program is used to control an autonomous robot at low-level. I have to
store all the velocities of both wheel during a second (1 measure per
milisecond). So I use a 60000 elements vector where each element store the
velocity of both wheels. So I have 120000 of floats (not integer I realize)



More information about the users mailing list