From: "Stéphane ANCELOT" <sancelot@free.fr>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: [Xenomai] rt_heap_alloc fails in shared session mode.
Date: Fri, 29 May 2015 15:21:42 +0200 [thread overview]
Message-ID: <556867E6.4040608@free.fr> (raw)
Hi,
The next code snippet fails in session mode.
I can create and allocate heaps from a program.
In another one, I can bind , but rt_heap_inquire fails with Invalid
argument.
Or I can use rt_alloc_heap with it. But when accessing memory, a bus
error is trapped.
//err = rt_heap_bind(heap_desc[module],module,TM_INFINITE);
err = rt_heap_bind(heap_desc[module],module,TM_INFINITE);
if (err != 0)
{
printf("can not bind %s [%s]\n",module,strerror(-err));
return (void *) -1;
}
// err = rt_heap_inquire(heap_desc[module],&info);
// if (err != 0) {
// printf("can not inquire info about %s
[%s]\n",module,strerror(-err));
// return (void *) -1;
// }
// printf("size %d\n,",info.heapsize);
err = rt_heap_alloc((RT_HEAP *)heap_desc[module],4288,TM_INFINITE,
&shmem);
if (err == 0)
{
return shmem;
}
else {
printf("can not alloc %s [%s]\n",module,strerror(-err));
return (void *) -1;
}
Regards,
S.Ancelot
reply other threads:[~2015-05-29 13:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=556867E6.4040608@free.fr \
--to=sancelot@free.fr \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.