summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/heap.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-01-25Remove make preinstallChris Johns1-518/+0
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
2017-08-22heap: Fix integer typesSebastian Huber1-3/+3
Update #3082.
2017-01-27score: Clarify _Heap_Extend()Sebastian Huber1-5/+6
Update #1747.
2017-01-27score: Fix typoSebastian Huber1-1/+1
2015-06-25score: Fix extern "C" in <rtems/score/heap.h>Sebastian Huber1-2/+1
2015-01-22score: Delete superfluous Heap_Statistics::instanceSebastian Huber1-5/+0
This value depends on the _Heap_Initialize() call sequence and carries no useful information.
2014-11-28score: Add heap statisticsSebastian Huber1-3/+22
Add lifetime bytes allocated and freed since they were present in the malloc statistics. Add number of failed allocations.
2014-11-28score: Return heap stats via _Heap_Get_informationSebastian Huber1-1/+2
Print out heap statistics via the MALLOC and WKSPACE shell commands.
2014-04-09score: Fix workspace size estimate for TLSSebastian Huber1-0/+5
2014-03-24score: _Heap_Protection_set_delayed_free_fractionSebastian Huber1-0/+1
Add and use _Heap_Protection_set_delayed_free_fraction(). This makes it possible to avoid a dependency on _Thread_Dispatch_is_enabled().
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2014-02-04score: Add _Heap_Size_with_overhead()Sebastian Huber1-0/+23
2013-07-24score: Move _Heap_Area_overhead() definition.Sebastian Huber1-1/+31
This function is used in bootcard.h.
2013-07-23score: Create heap implementation headerSebastian Huber1-372/+3
Move implementation specific parts of heap.h and heap.inl into new header file heapimpl.h. The heap.h contains now only the application visible API.
2013-06-25heap: Add _Heap_Greedy_allocate_all_except_largestSebastian Huber1-1/+15
Add rtems_workspace_greedy_allocate_all_except_largest() and rtems_heap_greedy_allocate_all_except_largest().
2013-06-21score: _Heap_Protection_free_all_delayed_blocks()Sebastian Huber1-0/+11
Add and use _Heap_Protection_free_all_delayed_blocks() to prevent test suite failures if RTEMS_DEBUG is defined.
2013-01-10cpukit: Use Consistent Beginning of Doxygen Group NotationJoel Sherrill1-2/+1
This is the result of a sed script which converts all uses of @{ into a consistent form.
2013-01-10cpukit: Add EOL on files missing EOL at EOFJoel Sherrill1-1/+1
2012-12-28score: Doxygen Clean Up Task #2Mathew Kallada1-2/+2
2012-12-14Fix spellingSebastian Huber1-1/+1
2012-10-25score: Work area initialization API changeSebastian Huber1-0/+30
The work areas (RTEMS work space and C program heap) will be initialized now in a separate step and are no longer part of rtems_initialize_data_structures(). Initialization is performed with tables of Heap_Area entries. This allows usage of scattered memory areas present on various small scale micro-controllers. The sbrk() support API changes also. The bsp_sbrk_init() must now deal with a minimum size for the first memory chunk to take the configured work space size into account.
2012-10-25score: Change _Heap_Extend() APISebastian Huber1-6/+53
The _Heap_Extend() has now the same signature as _Heap_Initialize(). The 4th parameter is ignored (page size in _Heap_Initialize()). Add Heap_Area and Heap_Initialization_or_extend_handler. Add and test _Heap_No_extend(). This helps to do a table based heap initialization and extension. Create a table of Heap_Area elements and iterate through it. Set the handler to _Heap_Initialize() in the first iteration and then to _Heap_Extend().
2012-07-17score: Change greedy allocation APISebastian Huber1-3/+5
2012-05-11Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill1-2/+0
Script does what is expected and tries to do it as smartly as possible. + remove occurrences of two blank comment lines next to each other after Id string line removed. + remove entire comment blocks which only exited to contain CVS Ids + If the processing left a blank line at the top of a file, it was removed.
2012-02-10Added support functions for greedy heap allocationSebastian Huber1-0/+23
Various tests must check program paths that result due to failed memory allocations from the heap. To avoid tinkering with internal heap structures throughout the test code these functions should be used.
2011-12-062011-12-06 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-0/+27
* score/src/heapiterate.c, score/src/pheapiterate.c: New files. * score/Makefile.am: Reflect changes above. * score/include/rtems/score/heap.h: Declare _Heap_Iterate() and define Heap_Block_visitor. * score/include/rtems/score/protectedheap.h: Declare _Protected_heap_Iterate(). * score/src/heapgetinfo.c: Use _Heap_Iterate().
2011-09-092011-09-09 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-3/+1
PR 1873/cpukit * score/include/rtems/score/heap.h: Revert previous commit. * sapi/include/confdefs.h: Use proper constants in _Configure_From_workspace().
2011-08-212011-08-21 Joel Sherrill <joel.sherrilL@OARcorp.com>Joel Sherrill1-1/+3
PR 1873/cpukit * score/include/rtems/score/heap.h: When using heap protection, we should account for adding an aligned protection footer.
2011-02-172011-02-17 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-5/+7
* libcsupport/src/rtems_heap_extend.c: New file. * libcsupport/Makefile.am: Reflect change from above. * libcsupport/include/rtems/malloc.h: Declare rtems_heap_extend(). * score/include/rtems/score/heap.h: Documentation.
2010-08-252010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-10/+107
PR 1672/cpukit * score/include/rtems/score/heap.h, score/src/heap.c, score/src/heapallocate.c, score/src/heapextend.c, score/src/heapfree.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c: Added heap protection in case RTEMS_DEBUG is defined.
2010-07-012010-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-1/+0
* libcsupport/src/rtems_memalign.c, score/include/rtems/score/heap.h: Remove stray references to malloc boundary.
2010-06-072010-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-14/+35
* score/include/rtems/score/heap.h: Declare _Heap_Get_first_and_last_block(). Removed Heap_Extend_status. Changed return type of _Heap_Extend() to bool. * score/inline/rtems/score/heap.inl: Define _Heap_Set_last_block_size(). * score/src/heap.c: Define and use _Heap_Get_first_and_last_block(). * score/src/heapgetinfo.c: Removed assert statements. Do not count the last block. This ensures that all size values are an integral multiple of the page size which is consistent with the other statistics. * score/src/heapextend.c: Implemented support for scattered heap areas. * score/src/heapwalk.c: Dump also last block. Changes for new first and last block values. * ./score/src/pheapextend.c, rtems/src/regionextend.c: Update for _Heap_Extend() changes.
2009-09-252009-09-25 Sebastian Huber <Sebastian.Huber@embedded-brains.de>Joel Sherrill1-9/+7
* score/src/heap.c, score/include/rtems/score/heap.h: Reduced alignment requirement for CPU_ALIGNMENT from four to two.
2009-09-092009-09-09 Sebastian Huber <Sebastian.Huber@embedded-brains.de>Joel Sherrill1-15/+44
* score/include/rtems/score/heap.h, score/inline/rtems/score/heap.inl, score/src/heapallocate.c, score/src/heap.c, score/src/heapextend.c, score/src/heapresizeblock.c, score/src/heapwalk.c: Documenation. Simplified block resize. Improved heap walk. Changed heap layout to avoid a special case for _Heap_Is_used() and _Heap_Is_free(). * libmisc/stackchk/check.c: Update for heap API changes.
2009-09-062009-09-06 Sebastian Huber <Sebastian.Huber@embedded-brains.de>Joel Sherrill1-233/+225
* libcsupport/src/free.c, libmisc/stackchk/check.c, rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c, rtems/src/regionextend.c, rtems/src/regiongetinfo.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapfree.c, score/src/pheapgetblocksize.c, score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c, score/src/pheapgetsize.c, score/src/pheapinit.c, score/src/pheapresizeblock.c, score/src/pheapwalk.c: Update for heap API changes. * score/include/rtems/score/apimutex.h, score/include/rtems/score/object.h: Documentation. * score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/inline/rtems/score/heap.inl, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapfree.c, score/src/heapgetfreeinfo.c, score/src/heapgetinfo.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/heapwalk.c: Overall cleanup. Added boundary constraint to allocation function. More changes follow.
2009-08-262009-08-24 Sebastian Huber <Sebastian.Huber@embedded-brains.de>Joel Sherrill1-244/+237
* libmisc/stackchk/check.c, rtems/src/regionreturnsegment.c, rtems/src/regiongetsegmentsize.c, src/heapalignupuptr.c, src/heapallocatealigned.c, src/heapallocate.c, src/heap.c, src/heapextend.c, src/heapfree.c, src/heapgetfreeinfo.c, src/heapgetinfo.c, src/heapresizeblock.c, src/heapsizeofuserarea.c, src/heapwalk.c, src/pheapgetblocksize.c, inline/rtems/score/heap.inl, include/rtems/score/heap.h: Overall cleanup. Changed all types for addresses, sizes, offsets and alignments to uintptr_t. Reformatted. Added variables for clarity. Renamed various objects. Enabled _HAssert() for all instances. More changes follow.
2009-08-092009-08-09 Xi Yang <hiyangxi@gmail.com>Joel Sherrill1-4/+4
* libcsupport/Makefile.am, posix/Makefile.am, rtems/Makefile.am, sapi/Makefile.am, score/Makefile.am, score/include/rtems/score/heap.h: HEAP_BLOCK_USED_OVERHEAD was under by one uint32_t. This showed up in the unlimited and heapwalk tests on ARM targets.
2009-08-052009-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>Joel Sherrill1-2/+15
* libcsupport/Makefile.am, rtems/Makefile.am, rtems/preinstall.am, sapi/Makefile.am, sapi/preinstall.am, score/Makefile.am, score/preinstall.am, score/include/rtems/score/heap.h, score/inline/rtems/score/heap.inl: Remove inline version now that it is in a C file. * libcsupport/src/end_profile.c: New file.
2009-05-052009-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-1/+1
* score/include/rtems/score/heap.h, score/inline/rtems/score/address.inl, score/inline/rtems/score/heap.inl, score/inline/rtems/score/object.inl, score/inline/rtems/score/priority.inl, score/inline/rtems/score/tod.inl: Remove warnings.
2008-12-22Eliminate TRUE/FALSE.Ralf Corsepius1-5/+5
2008-12-142008-12-14 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-12/+12
* libcsupport/src/realloc.c, rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c, rtems/src/regionextend.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionmp.c, rtems/src/regionresizesegment.c, sapi/include/rtems/config.h, score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapgetblocksize.c, score/src/pheapresizeblock.c: Change sizes of heap/region and allocated objects in heap to intptr_t so they can be larger than a single allocatable object (e.g. size_t).
2008-11-202008-11-20 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-10/+8
* score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/include/rtems/score/wkspace.h, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/pheapgetblocksize.c, score/src/wkspace.c: Revert use of ssize_t. This type is not guaranteed to be able to represent a positive number greater than the size of a single allocatable object. We needed a type that is able to represent the size of a pool of multiple allocatable objects or potentially nearly all memory.
2008-10-022008-10-02 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-8/+10
* libcsupport/src/malloc_statistics_helpers.c, libcsupport/src/realloc.c, rtems/include/rtems/rtems/region.h, rtems/include/rtems/rtems/support.h, rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c, rtems/src/workspace.c, sapi/include/confdefs.h, score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/include/rtems/score/wkspace.h, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/pheapgetblocksize.c, score/src/wkspace.c: Change size_t to ssize_t on all Heap, Workspace and Region calls. On 16-bit architectures, size_t can be 16-bits which would limit sizes to 64K.
2008-09-04Convert to "bool".Ralf Corsepius1-4/+4
2008-01-292008-01-29 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-2/+1
* score/Doxyfile: Update to latest Doxygen format. * score/include/rtems/score/apimutex.h, score/include/rtems/score/corebarrier.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/corerwlock.h, score/include/rtems/score/heap.h, score/include/rtems/score/object.h, score/include/rtems/score/protectedheap.h, score/include/rtems/score/thread.h, score/include/rtems/score/threadsync.h, score/include/rtems/score/tod.h, score/inline/rtems/score/corerwlock.inl, score/inline/rtems/score/corespinlock.inl: Remove most doxygen warnings.
2007-07-112007-07-11 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-1/+1
* libcsupport/src/malloc.c: Clean up Malloc debug code. * score/include/rtems/score/heap.h: Spacing. * score/inline/rtems/score/thread.inl: * score/src/heapfree.c. Clean up and add explicit check of the address being freed actually being in the heap. * score/src/heapwalk.c: Switch to printk and do not call abort.
2007-02-11More size_t for heap-sizes.Ralf Corsepius1-4/+4
2007-02-11Use size_t for heap-sizes.Ralf Corsepius1-4/+4
2006-01-162006-01-16 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-49/+74
Large patch to improve Doxygen output. As a side-effect, grammar and spelling errors were corrected, spacing errors were address, and some variable names were improved. * libmisc/monitor/mon-object.c, libmisc/monitor/monitor.h: Account for changing OBJECTS_NO_CLASS to OBJECTS_CLASSIC_NO_CLASS. * score/Doxyfile: Set output directory. Predefine some macro values. Turn on graphical output. * score/include/rtems/debug.h, score/include/rtems/seterr.h, score/include/rtems/system.h, score/include/rtems/score/address.h, score/include/rtems/score/apiext.h, score/include/rtems/score/apimutex.h, score/include/rtems/score/bitfield.h, score/include/rtems/score/chain.h, score/include/rtems/score/context.h, score/include/rtems/score/coremsg.h, score/include/rtems/score/coremutex.h, score/include/rtems/score/coresem.h, score/include/rtems/score/heap.h, score/include/rtems/score/interr.h, score/include/rtems/score/isr.h, score/include/rtems/score/mpci.h, score/include/rtems/score/mppkt.h, score/include/rtems/score/object.h, score/include/rtems/score/objectmp.h, score/include/rtems/score/priority.h, score/include/rtems/score/stack.h, score/include/rtems/score/states.h, score/include/rtems/score/sysstate.h, score/include/rtems/score/thread.h, score/include/rtems/score/threadmp.h, score/include/rtems/score/threadq.h, score/include/rtems/score/tod.h, score/include/rtems/score/tqdata.h, score/include/rtems/score/userext.h, score/include/rtems/score/watchdog.h, score/include/rtems/score/wkspace.h, score/inline/rtems/score/address.inl, score/inline/rtems/score/chain.inl, score/inline/rtems/score/coremutex.inl, score/inline/rtems/score/coresem.inl, score/inline/rtems/score/heap.inl, score/inline/rtems/score/object.inl, score/inline/rtems/score/stack.inl, score/inline/rtems/score/thread.inl, score/inline/rtems/score/tqdata.inl, score/macros/README, score/src/heap.c, score/src/threadmp.c, score/src/threadready.c, score/src/threadstartmultitasking.c: Improve generated Doxygen output. Fix spelling and grammar errors in comments. Correct names of some variables and propagate changes.
2005-05-202005-05-14 Sergei Organov <osv@topconrd.ru>Joel Sherrill1-2/+44
PR 746/rtems Optimize realloc(). The problem is that realloc() can neither grow nor shrink efficiently the current memory region without support from underlying heap/region modules. The patch introduces one new routine for each of heap and region modules, _Heap_Resize_block(), and rtems_region_resize_segment(), respectively, and uses the latter to optimize realloc(). The implementation of _Heap_Resize_block() lead to changing of the heap allocation strategy: now the heap manager, when splits larger free block into used and new free parts, makes the first part of the block used, not the last one as it was before. Due to this new strategy, _Heap_Resize_block() never needs to change the user pointer. Caveat: unlike previous heap implementation, first few bytes of the contents of the memory allocated from the heap are now almost never all zero. This can trigger bugs in client code that have not been visible before this patch. * libcsupport/src/malloc.c (realloc): try to resize segment in place using new rtems_region_resize_segment() routine before falling back to the malloc()/free() method. * score/src/heap.c: (_Heap_Initialize): change initial heap layout to reflect new allocation strategy of using of the lower part of a previously free block when splitting it for the purpose of allocation. (_Heap_Block_allocate): when split, make the lower part used, and leave the upper part free. Return type changed from Heap_Block* to uint32_t. * score/include/rtems/score/heap.h: (Heap_Statistics): added 'resizes' field. (Heap_Resize_status): new enum. (_Heap_Resize_block): new routine. (_Heap_Block_allocate): return type changed from Heap_Block* to uint32_t. * score/src/heapwalk.c: reflect new heap layout in checks. * score/src/heapsizeofuserarea.c: more assertions added. * score/src/heapresizeblock.c: new file. (_Heap_Resize_block): new routine. * score/src/heapfree.c: reverse the checks _Heap_Is_block_in() and _Heap_Is_prev_used() on entry to be in this order. * score/src/heapallocate.c, score/src/heapallocatealigned.c: ignore return value of _Heap_Block_allocate(). * score/Makefile.am (HEAP_C_FILES): added src/heapresizeblock.c. * rtems/include/rtems/rtems/region.h: (rtems_region_resize_segment): new interface routine. (_Region_Process_queue): new internal routine called from rtems_region_resize_segment() and rtems_region_return_segment(). * rtems/src/regionreturnsegment.c: move queue management code into the new internal routine _Region_Process_queue() and call it. * rtems/src/regionresizesegment.c: new file. (rtems_region_resize_segment): new interface routine. * rtems/src/regionprocessqueue.c: new file. (_Region_Process_queue): new internal routine containing queue management code factored out from 'regionreturnsegment.c'. * rtems/Makefile.am (REGION_C_FILES): Added src/regionresizesegment.c, and src/regionprocessqueue.c. * ada/rtems.adb, ada/rtems.ads: Added Region_Resize_Segment.