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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Jan 27 10:16:11 2017 +0100

boilerplate/tlsf: work around excessive meta-data overhead for main pool

e0e6ae76 caused a regression with failure to initialize the main pool
with TLSF, uncovering an issue in the allocator code which fails to
account properly for the overhead induced by the meta-data.

Overhead footprints and management is a recurring problem with TLSF,
particularly on 64bit platforms; for this reason there is a plan for
dropping TLSF entirely from the Xenomai code base. Until this happens,
the current change works around the issue to keep things going.

---

 lib/boilerplate/tlsf/tlsf.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/boilerplate/tlsf/tlsf.c b/lib/boilerplate/tlsf/tlsf.c
index 8ee9405..2dddc1e 100644
--- a/lib/boilerplate/tlsf/tlsf.c
+++ b/lib/boilerplate/tlsf/tlsf.c
@@ -626,6 +626,7 @@ void *tlsf_malloc(size_t size)
 
        area_size = sizeof(tlsf_t) + BHDR_OVERHEAD * 8; /* Just a safety 
constant */
        area_size += size;
+       area_size += (1 << (ms_bit(area_size) - MAX_LOG2_SLI)) - 1;
        area_size = (area_size > DEFAULT_AREA_SIZE) ? area_size : 
DEFAULT_AREA_SIZE;
        area = get_new_area(&area_size);
        if (area == ((void *) ~0))


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

Reply via email to