This patch allows the application to add memjoin heursitic.

-- 
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA  developer kit
### Eclipse Workspace Patch 1.0
#P ecos
Index: services/memalloc/common/current/src/malloc.cxx
===================================================================
RCS file: 
/cvs/ecos/ecos/packages/services/memalloc/common/current/src/malloc.cxx,v
retrieving revision 1.7
diff -u -r1.7 malloc.cxx
--- services/memalloc/common/current/src/malloc.cxx     24 Oct 2007 16:19:54 
-0000      1.7
+++ services/memalloc/common/current/src/malloc.cxx     5 Nov 2007 09:30:19 
-0000
@@ -99,8 +99,11 @@
 
 #else 
 // multiple heaps
-
+#ifdef CYGBLD_MEMALLOC_MALLOC_EXTERNAL_JOIN_H
+# include CYGBLD_MEMALLOC_MALLOC_EXTERNAL_JOIN_H
+#else
 # include <cyg/memalloc/memjoin.hxx>
+#endif
 
 Cyg_Mempool_Joined<CYGCLS_MEMALLOC_MALLOC_IMPL> cyg_memalloc_mallocpool
    CYGBLD_ATTRIB_INIT_PRI( CYG_INIT_MEMALLOC ) =
Index: services/memalloc/common/current/cdl/memalloc.cdl
===================================================================
RCS file: 
/cvs/ecos/ecos/packages/services/memalloc/common/current/cdl/memalloc.cdl,v
retrieving revision 1.15
diff -u -r1.15 memalloc.cdl
--- services/memalloc/common/current/cdl/memalloc.cdl   30 Jul 2005 11:42:55 
-0000      1.15
+++ services/memalloc/common/current/cdl/memalloc.cdl   5 Nov 2007 09:30:19 
-0000
@@ -305,6 +305,20 @@
                            be set to a header which provides the equivalent
                            definitions to <pkgconf/heaps.hxx>."
         }
+        
+        cdl_component CYGBLD_MEMALLOC_MALLOC_EXTERNAL_JOIN_H {
+            display       "Use external implementation of joining multiple 
heaps"
+            flavor        booldata
+            default_value 0
+            description   "The default implementation of joining multiple heaps
+                           is fine for the case where there are multiple 
disjoint
+                           memory regions of the same type. However, in a 
system
+                           there might be e.g. a small amount of internal SRAM 
and
+                           a large amount of external DRAM. The SRAM is faster 
and
+                           the DRAM is slower. An application can implement 
some 
+                           heuristic to choose which pool to allocate from. 
This
+                           heuristic can be highly application specific."
+        }
 
         cdl_interface CYGINT_MEMALLOC_MALLOC_ALLOCATORS {
             display       "malloc() allocator implementations"
Index: services/memalloc/common/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/memalloc/common/current/ChangeLog,v
retrieving revision 1.41
diff -u -r1.41 ChangeLog
--- services/memalloc/common/current/ChangeLog  24 Oct 2007 13:25:46 -0000      
1.41
+++ services/memalloc/common/current/ChangeLog  5 Nov 2007 09:30:19 -0000
@@ -1,3 +1,7 @@
+2007-11-05  Oyvind Harboe <[EMAIL PROTECTED]>
+       * Added option CYGBLD_MEMALLOC_MALLOC_EXTERNAL_JOIN_H to let
+       application implement a way to pick the pool to allocate memory from
+       based on application specifi heursitic.
 2007-10-24  Oyvind Harboe <[EMAIL PROTECTED]>
 2007-10-24  Jonathan Larmour  <[EMAIL PROTECTED]>
 

Reply via email to