On 05/05/2015 03:37 PM, Stéphane ANCELOT wrote:
> Hi,
> unfortunately, There is something wrong for unknown reason using these
> functions.
>
> I made a simple regression program that only create heaps and allocates
> area.
>
> At line 190 of the file, depending on the size value of the heap, the
> program works or not.
> This looks like corrupted memory problem...
>
The API tells you what happens, it's just that you did not pay attention
to return codes:
flags = H_FIFO ;
size = 36800;
size = 824; // size = 824 is failing but changing size to 3200 rocks ...
ret = rt_heap_create(&heap2, "config", size, flags);
This returns -EINVAL, which is documented for rt_heap_create() as:
* - -EINVAL is returned if @a mode is invalid, or @a heapsz is not in
* the range [2k..2Gb].
Besides, your test code never deletes the heaps it creates, before
overwriting the same heap descriptor with the next call to
rt_heap_create(). Hopefully your application does not do that.
I'm unsure to understand your reasoning about memory corruption.
--
Philippe.
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai