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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Jun 19 15:17:06 2015 +0200

alchemy/heap: remove restriction on tiny heaps

---

 lib/alchemy/heap.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/alchemy/heap.c b/lib/alchemy/heap.c
index 10b7f83..79de42b 100644
--- a/lib/alchemy/heap.c
+++ b/lib/alchemy/heap.c
@@ -179,7 +179,7 @@ fnref_register(libalchemy, heap_finalize);
  * @param heapsz The size (in bytes) of the memory pool, blocks will
  * be claimed and released to.  This area is not extensible, so this
  * value must be compatible with the highest memory pressure that
- * could be expected. The valid range is between 2k and 2Gb.
+ * could be expected. The valid range is between 1 byte and 2Gb.
  *
  * @param mode The heap creation mode. The following flags can be
  * OR'ed into this bitmask, each of them affecting the new heap:
@@ -195,8 +195,8 @@ fnref_register(libalchemy, heap_finalize);
  *
  * @return Zero is returned upon success. Otherwise:
  *
- * - -EINVAL is returned if @a mode is invalid, or @a heapsz is not in
- * the range [2k..2Gb].
+ * - -EINVAL is returned if @a mode is invalid, or @a heapsz is zero
+ * or larger than 2Gb.
  *
  * - -ENOMEM is returned if the system fails to get memory from the
  * main heap in order to create the heap.
@@ -222,7 +222,7 @@ int rt_heap_create(RT_HEAP *heap,
        if (threadobj_irq_p())
                return -EPERM;
 
-       if (heapsz < 2048 || heapsz >= 1U << 31)
+       if (heapsz == 0 || heapsz >= 1U << 31)
                return -EINVAL;
 
        if (mode & ~(H_PRIO|H_SINGLE))


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to