Module: xenomai-forge
Branch: master
Commit: 2019d1538fdf293ba14098b70a3cb656476056ed
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=2019d1538fdf293ba14098b70a3cb656476056ed

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Dec 14 11:13:42 2011 +0100

alchemy/queue: give array hint when available for allocating the pool

---

 lib/alchemy/queue.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/lib/alchemy/queue.c b/lib/alchemy/queue.c
index 218f2d1..0dcd7ce 100644
--- a/lib/alchemy/queue.c
+++ b/lib/alchemy/queue.c
@@ -69,7 +69,14 @@ int rt_queue_create(RT_QUEUE *queue, const char *name,
         * The message pool has to be part of the main heap for proper
         * sharing between processes.
         */
-       if (heapobj_init_shareable(&qcb->hobj, qcb->name, poolsize)) {
+       if (qlimit == Q_UNLIMITED)
+               ret = heapobj_init_shareable(&qcb->hobj, qcb->name,
+                                            poolsize);
+       else
+               ret = heapobj_init_array_shareable(&qcb->hobj, qcb->name,
+                                                  poolsize / qlimit,
+                                                  qlimit);
+       if (ret) {
                xnfree(qcb);
                goto out;
        }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to