* [Xenomai] heap: bad usage or design problem using named heaps ?
@ 2015-03-26 9:48 Stéphane ANCELOT
2015-03-26 10:45 ` Philippe Gerum
0 siblings, 1 reply; 2+ messages in thread
From: Stéphane ANCELOT @ 2015-03-26 9:48 UTC (permalink / raw)
To: Xenomai
Hi,
I faced the following problem with xeno 2.5.x , but may exist on other
releases .
1/ I create a rt_heap
2/ in this rh_heap I alloc many named "data area"
I always give the global rt_heap ptr. no problem, areas are allocated.
3/problem arises when unallocating/unbinding
using rt_heap_free/rt_heap_unbind.
only the last segment created is freed. Because the global heap ptr size
contains only size of the last allocation.
============================
to solve the problem, I had to use a distinct rt_heap for each named
area, in this case.
At first, I may have misunderstood the way was working rt_heaps ?
I was thinking I could manage only a heap with many named modules inside
it...
Regards
S.Ancelot
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai] heap: bad usage or design problem using named heaps ?
2015-03-26 9:48 [Xenomai] heap: bad usage or design problem using named heaps ? Stéphane ANCELOT
@ 2015-03-26 10:45 ` Philippe Gerum
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2015-03-26 10:45 UTC (permalink / raw)
To: Stéphane ANCELOT, Xenomai
On 03/26/2015 10:48 AM, Stéphane ANCELOT wrote:
> Hi,
>
> I faced the following problem with xeno 2.5.x , but may exist on other
> releases .
>
Or may not, since 2.5.x is obsolete (last release on August 2012), or if
this turns to be usage issue.
> 1/ I create a rt_heap
> 2/ in this rh_heap I alloc many named "data area"
Some code is needed to understand the kind of heap your code creates.
> I always give the global rt_heap ptr. no problem, areas are allocated.
>
> 3/problem arises when unallocating/unbinding
> using rt_heap_free/rt_heap_unbind.
These routines have very different purposes. Why are you coupling them
in your description of the issue?
> only the last segment created is freed. Because the global heap ptr size
> contains only size of the last allocation.
I don't understand what you mean.
>
>
> ============================
> to solve the problem, I had to use a distinct rt_heap for each named
> area, in this case.
What is a "named area" in the context of your application, if not a
separate named heap in single-block mode (H_SINGLE)?
>
> At first, I may have misunderstood the way was working rt_heaps ?
> I was thinking I could manage only a heap with many named modules inside
> it...
>
Please send a simple code fragment illustrating your use case.
--
Philippe.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-26 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-26 9:48 [Xenomai] heap: bad usage or design problem using named heaps ? Stéphane ANCELOT
2015-03-26 10:45 ` Philippe Gerum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.