Mercurial > ecos
comparison packages/services/memalloc/common/current/cdl/memalloc.cdl @ 115:6ed91473a1cd ecos-sw-2000-08-21
Merge from eCos master repository on 2000-08-21-22:40:54-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 17:32:38 +0000 |
| parents | |
| children | 77cec8369160 |
comparison
equal
deleted
inserted
replaced
| 114:5ad2b71d525e | 115:6ed91473a1cd |
|---|---|
| 1 # ==================================================================== | |
| 2 # | |
| 3 # memalloc.cdl | |
| 4 # | |
| 5 # Dynamic memory allocator services configuration data | |
| 6 # | |
| 7 # ==================================================================== | |
| 8 #####COPYRIGHTBEGIN#### | |
| 9 # | |
| 10 # ------------------------------------------- | |
| 11 # The contents of this file are subject to the Red Hat eCos Public License | |
| 12 # Version 1.1 (the "License"); you may not use this file except in | |
| 13 # compliance with the License. You may obtain a copy of the License at | |
| 14 # http://www.redhat.com/ | |
| 15 # | |
| 16 # Software distributed under the License is distributed on an "AS IS" | |
| 17 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 18 # License for the specific language governing rights and limitations under | |
| 19 # the License. | |
| 20 # | |
| 21 # The Original Code is eCos - Embedded Configurable Operating System, | |
| 22 # released September 30, 1998. | |
| 23 # | |
| 24 # The Initial Developer of the Original Code is Red Hat. | |
| 25 # Portions created by Red Hat are | |
| 26 # Copyright (C) 1998, 1999, 2000 Red Hat, Inc. | |
| 27 # All Rights Reserved. | |
| 28 # ------------------------------------------- | |
| 29 # | |
| 30 #####COPYRIGHTEND#### | |
| 31 # ==================================================================== | |
| 32 ######DESCRIPTIONBEGIN#### | |
| 33 # | |
| 34 # Author(s): jlarmour | |
| 35 # Contributors: | |
| 36 # Date: 2000-06-02 | |
| 37 # | |
| 38 #####DESCRIPTIONEND#### | |
| 39 # | |
| 40 # ==================================================================== | |
| 41 | |
| 42 cdl_package CYGPKG_MEMALLOC { | |
| 43 display "Dynamic memory allocation" | |
| 44 description " | |
| 45 This package provides memory allocator infrastructure required for | |
| 46 dynamic memory allocators, including the ISO standard malloc | |
| 47 interface. It also contains some sample implementations." | |
| 48 include_dir cyg/memalloc | |
| 49 compile dlmalloc.cxx kapi.cxx malloc.cxx memfixed.cxx memvar.cxx | |
| 50 | |
| 51 # ==================================================================== | |
| 52 | |
| 53 cdl_component CYGPKG_MEMALLOC_ALLOCATORS { | |
| 54 display "Memory allocator implementations" | |
| 55 flavor none | |
| 56 no_define | |
| 57 description " | |
| 58 This component contains configuration options related to the | |
| 59 various memory allocators available." | |
| 60 | |
| 61 cdl_component CYGPKG_MEMALLOC_ALLOCATOR_FIXED { | |
| 62 display "Fixed block allocator" | |
| 63 flavor none | |
| 64 no_define | |
| 65 description " | |
| 66 This component contains configuration options related to the | |
| 67 fixed block memory allocator." | |
| 68 | |
| 69 cdl_option CYGSEM_MEMALLOC_ALLOCATOR_FIXED_THREADAWARE { | |
| 70 display "Make thread safe" | |
| 71 active_if CYGPKG_KERNEL | |
| 72 default_value 1 | |
| 73 description " | |
| 74 With this option enabled, this allocator will be | |
| 75 made thread-safe. Additionally allocation functions | |
| 76 are made available that allow a thread to wait | |
| 77 until memory is available." | |
| 78 } | |
| 79 } | |
| 80 | |
| 81 cdl_component CYGPKG_MEMALLOC_ALLOCATOR_VARIABLE { | |
| 82 display "Simple variable block allocator" | |
| 83 flavor none | |
| 84 no_define | |
| 85 description " | |
| 86 This component contains configuration options related to the | |
| 87 simple variable block memory allocator." | |
| 88 | |
| 89 cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_THREADAWARE { | |
| 90 display "Make thread safe" | |
| 91 active_if CYGPKG_KERNEL | |
| 92 default_value 1 | |
| 93 description " | |
| 94 With this option enabled, this allocator will be | |
| 95 made thread-safe. Additionally allocation functions | |
| 96 are added that allow a thread to wait until memory | |
| 97 are made available that allow a thread to wait | |
| 98 until memory is available." | |
| 99 } | |
| 100 | |
| 101 cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE { | |
| 102 display "Coalesce memory" | |
| 103 default_value 1 | |
| 104 description " | |
| 105 The variable-block memory allocator can perform coalescing | |
| 106 of memory whenever the application code releases memory back | |
| 107 to the pool. This coalescing reduces the possibility of | |
| 108 memory fragmentation problems, but involves extra code and | |
| 109 processor cycles." | |
| 110 } | |
| 111 } | |
| 112 | |
| 113 cdl_component CYGPKG_MEMALLOC_ALLOCATOR_DLMALLOC { | |
| 114 display "Doug Lea's malloc" | |
| 115 flavor none | |
| 116 description " | |
| 117 This component contains configuration options related to the | |
| 118 port of Doug Lea's memory allocator, normally known as | |
| 119 dlmalloc." | |
| 120 | |
| 121 cdl_option CYGDBG_MEMALLOC_ALLOCATOR_DLMALLOC_DEBUG { | |
| 122 display "Debug build" | |
| 123 requires CYGDBG_USE_ASSERTS | |
| 124 default_value { 0 != CYGDBG_USE_ASSERTS } | |
| 125 description " | |
| 126 Doug Lea's malloc implementation has substantial amounts | |
| 127 of internal checking in order to verify the operation | |
| 128 and consistency of the allocator. However this imposes | |
| 129 substantial overhead on each operation. Therefore this | |
| 130 checking may be individually disabled." | |
| 131 } | |
| 132 | |
| 133 cdl_option CYGIMP_MEMALLOC_ALLOCATOR_DLMALLOC_THREADAWARE { | |
| 134 display "Make thread safe" | |
| 135 active_if CYGPKG_KERNEL | |
| 136 requires CYGPKG_KERNEL | |
| 137 default_value 1 | |
| 138 description " | |
| 139 With this option enabled, this allocator will be | |
| 140 made thread-safe. Additionally allocation functions | |
| 141 are made available that allow a thread to wait | |
| 142 until memory is available." | |
| 143 } | |
| 144 | |
| 145 cdl_option CYGIMP_MEMALLOC_ALLOCATOR_DLMALLOC_SAFE_MULTIPLE { | |
| 146 display "Support more than one instance" | |
| 147 default_value 1 | |
| 148 description " | |
| 149 Having this option disabled allows important | |
| 150 implementation structures to be declared as a single | |
| 151 static instance, allowing faster access. However this | |
| 152 would fail if there is more than one instance of | |
| 153 the dlmalloc allocator class. Therefore this option can | |
| 154 be enabled if multiple instances are required. Note: as | |
| 155 a special case, if this allocator is used as the | |
| 156 implementation of malloc, and it can be determined there | |
| 157 is more than one malloc pool, then this option will be | |
| 158 silently enabled." | |
| 159 } | |
| 160 | |
| 161 cdl_option CYGIMP_MEMALLOC_ALLOCATOR_DLMALLOC_USE_MEMCPY { | |
| 162 display "Use system memcpy() and memset()" | |
| 163 requires CYGPKG_ISOINFRA | |
| 164 default_value { 0 != CYGPKG_ISOINFRA } | |
| 165 description " | |
| 166 This may be used to control whether memset() and memcpy() | |
| 167 are used within the implementation. The alternative is | |
| 168 to use some macro equivalents, which some people report | |
| 169 are faster in some circumstances." | |
| 170 } | |
| 171 } | |
| 172 } | |
| 173 | |
| 174 cdl_option CYGFUN_MEMALLOC_KAPI { | |
| 175 display "Kernel C API support for memory allocation" | |
| 176 active_if CYGPKG_KERNEL | |
| 177 default_value CYGFUN_KERNEL_API_C | |
| 178 description " | |
| 179 This option must be enabled to provide the extensions required | |
| 180 to support integration into the kernel C API." | |
| 181 } | |
| 182 | |
| 183 cdl_component CYGPKG_MEMALLOC_MALLOC_ALLOCATORS { | |
| 184 display "malloc() and supporting allocators" | |
| 185 flavor bool | |
| 186 active_if CYGPKG_ISOINFRA | |
| 187 implements CYGINT_ISO_MALLOC | |
| 188 implements CYGINT_ISO_MALLINFO | |
| 189 default_value 1 | |
| 190 description " | |
| 191 This component enables support for dynamic memory | |
| 192 allocation as supplied by the functions malloc(), | |
| 193 free(), calloc() and realloc(). As these | |
| 194 functions are often used, but can have quite an | |
| 195 overhead, disabling them here can ensure they | |
| 196 cannot even be used accidentally when static | |
| 197 allocation is preferred. Within this component are | |
| 198 various allocators that can be selected for use | |
| 199 as the underlying implementation of the dynamic | |
| 200 allocation functions." | |
| 201 | |
| 202 make -priority 50 { | |
| 203 heapgeninc.tcl : <PACKAGE>/src/heapgen.cpp | |
| 204 $(CC) $(CFLAGS) $(INCLUDE_PATH) -Wp,-MD,heapgen.tmp -E $< > $@ | |
| 205 @echo $@ ':' $< '\' > $(notdir $@).deps | |
| 206 @tail +2 heapgen.tmp >> $(notdir $@).deps | |
| 207 @echo >> $(notdir $@).deps | |
| 208 @rm heapgen.tmp | |
| 209 } | |
| 210 | |
| 211 # FIXME this should have a dependency on mlt_headers, but CDL doesn't | |
| 212 # permit custom build rules depending on phony targets | |
| 213 # FIXME we workaround an NT cygtclsh80 bug by cd'ing into the | |
| 214 # correct dir and running heapgen.tcl from there rather than passing | |
| 215 # an absolute path. | |
| 216 make -priority 50 { | |
| 217 heaps.cxx : heapgeninc.tcl <PACKAGE>/src/heapgen.tcl | |
| 218 sh -c "cd $(REPOSITORY)/$(PACKAGE)/src ; sh heapgen.tcl $(PREFIX) `pwd`" | |
| 219 @cp heaps.hxx $(PREFIX)/include/pkgconf/heaps.hxx | |
| 220 @chmod u+w $(PREFIX)/include/pkgconf/heaps.hxx | |
| 221 } | |
| 222 | |
| 223 make_object { | |
| 224 heaps.o.d : heaps.cxx | |
| 225 $(CC) $(CFLAGS) $(INCLUDE_PATH) -Wp,-MD,heaps.tmp -c -o $(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $< | |
| 226 @echo $@ ':' $< '\' > $@ | |
| 227 @tail +2 heaps.tmp >> $@ | |
| 228 @echo >> $@ | |
| 229 @rm heaps.tmp | |
| 230 } | |
| 231 | |
| 232 cdl_interface CYGINT_MEMALLOC_MALLOC_ALLOCATORS { | |
| 233 display "malloc() allocator implementations" | |
| 234 requires { CYGINT_MEMALLOC_MALLOC_ALLOCATORS == 1 } | |
| 235 no_define | |
| 236 } | |
| 237 | |
| 238 cdl_option CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER { | |
| 239 display "malloc() implementation instantiation data" | |
| 240 flavor data | |
| 241 description " | |
| 242 Memory allocator implementations that are capable of being | |
| 243 used underneath malloc() must be instantiated. The code | |
| 244 to do this is set in this option. It is only intended to | |
| 245 be set by the implementation, not the user." | |
| 246 # default corresponds to the default allocator | |
| 247 default_value {"<cyg/memalloc/memvar.hxx>"} | |
| 248 } | |
| 249 | |
| 250 cdl_option CYGIMP_MEMALLOC_MALLOC_VARIABLE_SIMPLE { | |
| 251 display "Simple variable block implementation" | |
| 252 description "This causes malloc() to use the simple | |
| 253 variable block allocator." | |
| 254 default_value 1 | |
| 255 implements CYGINT_MEMALLOC_MALLOC_ALLOCATORS | |
| 256 requires { CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER == \ | |
| 257 "<cyg/memalloc/memvar.hxx>" } | |
| 258 requires CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE | |
| 259 } | |
| 260 | |
| 261 cdl_option CYGIMP_MEMALLOC_MALLOC_DLMALLOC { | |
| 262 display "Doug Lea's malloc implementation" | |
| 263 description "This causes malloc() to use a version of Doug Lea's | |
| 264 malloc (dlmalloc) as the underlying implementation." | |
| 265 default_value 0 | |
| 266 implements CYGINT_MEMALLOC_MALLOC_ALLOCATORS | |
| 267 requires { CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER == \ | |
| 268 "<cyg/memalloc/dlmalloc.hxx>" } | |
| 269 } | |
| 270 } | |
| 271 cdl_option CYGNUM_MEMALLOC_FALLBACK_MALLOC_POOL_SIZE { | |
| 272 display "Size of the fallback dynamic memory pool in bytes" | |
| 273 flavor data | |
| 274 legal_values 32 to 0x7fffffff | |
| 275 default_value 16384 | |
| 276 description " | |
| 277 If *no* heaps are configured in your memory layout, | |
| 278 dynamic memory allocation by | |
| 279 malloc() and calloc() must be from a fixed-size, | |
| 280 contiguous memory pool (note here that it is the | |
| 281 pool that is of a fixed size, but malloc() is still | |
| 282 able to allocate variable sized chunks of memory | |
| 283 from it). This option is the size | |
| 284 of that pool, in bytes. Note that not all of | |
| 285 this is available for programs to | |
| 286 use - some is needed for internal information | |
| 287 about memory regions, and some may be lost to | |
| 288 ensure that memory allocation only returns | |
| 289 memory aligned on word (or double word) | |
| 290 boundaries - a very common architecture | |
| 291 constraint." | |
| 292 } | |
| 293 # ==================================================================== | |
| 294 | |
| 295 cdl_component CYGPKG_MEMALLOC_OPTIONS { | |
| 296 display "Common memory allocator package build options" | |
| 297 flavor none | |
| 298 no_define | |
| 299 description " | |
| 300 Package specific build options including control over | |
| 301 compiler flags used only in building this package, | |
| 302 and details of which tests are built." | |
| 303 | |
| 304 cdl_option CYGPKG_MEMALLOC_CFLAGS_ADD { | |
| 305 display "Additional compiler flags" | |
| 306 flavor data | |
| 307 no_define | |
| 308 default_value { "" } | |
| 309 description " | |
| 310 This option modifies the set of compiler flags for | |
| 311 building this package. These flags are used in addition | |
| 312 to the set of global flags." | |
| 313 } | |
| 314 | |
| 315 cdl_option CYGPKG_MEMALLOC_CFLAGS_REMOVE { | |
| 316 display "Suppressed compiler flags" | |
| 317 flavor data | |
| 318 no_define | |
| 319 default_value { "" } | |
| 320 description " | |
| 321 This option modifies the set of compiler flags for | |
| 322 building this package. These flags are removed from | |
| 323 the set of global flags if present." | |
| 324 } | |
| 325 | |
| 326 cdl_option CYGPKG_MEMALLOC_TESTS { | |
| 327 display "Tests" | |
| 328 flavor data | |
| 329 no_define | |
| 330 calculated { "tests/dlmalloc1 tests/dlmalloc2 tests/kmemfix1 tests/kmemvar1 tests/malloc1 tests/malloc2 tests/malloc3 tests/malloc4 tests/memfix1 tests/memfix2 tests/memvar1 tests/memvar2 tests/realloc" } | |
| 331 description " | |
| 332 This option specifies the set of tests for this package." | |
| 333 } | |
| 334 } | |
| 335 } | |
| 336 | |
| 337 # ==================================================================== | |
| 338 # EOF memalloc.cdl |
