Dehann Fourie wrote:
> Hi,
>
> Sorry for the lack of information, I'm still bit of a new guy. I have found
> the following (I do use a mlockall(current | future)):
>
> When i declare larger arrays in the real-time task I get the segmentation
> fault. This is when I declare as follows
> double arr[10000]; //some KB sized value
>
> When I use malloc I don't get the problem. My question now is where does the
> first one declare the memory. I am assuming that the malloc declares strait
> into the RAM, becuase there I am safe to declare a couple of MB?
It depends on where you declare double arr[10000]. If this is outside of
any scope, then it ends up in an anonmous map. If this is declared in a
function, then it ends up on the current thread stack, so, in this case
the current thread stack has to be large enough to allow such an
allocation (in your case, sizeof(arr) == 80000, that is around 80Kbytes).
--
Gilles.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help