summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/free.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-04-01cpukit/libcsupport/src/[a-f]*: Change license to BSD-2Joel Sherrill1-3/+22
Updates #3053.
2020-07-24malloc: Make deferred free support optionalSebastian Huber1-0/+43
Only include the deferred free support if free() is actually used by the application. The free() implementation in RTEMS supports that allocated memory is freed in interrupt context. Since the heap is protected by a mutex, the frees issued in interrupt context cannot immediately be freed to the heap, instead they are placed on a deferred free list. This list is emptied by the core allocation function rtems_heap_allocate_aligned_with_boundary(). This adds a dependency to free() in rtems_heap_allocate_aligned_with_boundary(). In order to better support applications which only allocate memory and never free it, this dependency should be avoided. Provide a weak default implementation of _Malloc_Process_deferred_frees() for rtems_heap_allocate_aligned_with_boundary(). In the free() module provide the strong implementation. Close #4032.
2020-04-28doxygen: Switch @brief and @ingroupSebastian Huber1-1/+2
This order change fixes the Latex documentation build via Doxygen.
2020-04-16Canonicalize config.h includeSebastian Huber1-1/+1
Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
2018-06-05Add RTEMS_FATAL_SOURCE_INVALID_HEAP_FREESebastian Huber1-6/+1
An invalid heap usage such as a double free is usually a fatal error since this indicates a use after free. Replace the use of printk() in free() with a fatal error. Update #3437.
2016-05-25libcsupport: Fix printk warnings.Chris Johns1-2/+2
2016-02-25malloc: Add _Malloc_System_state()Sebastian Huber1-6/+2
Replace malloc_is_system_state_OK() with _Malloc_System_state() to allow early allocations, e.g. in bsp_start(). Here the _Thread_Executing is NULL, thus an _API_Mutex_Lock() would lead to a NULL pointer access. Move malloc() support code to general case rtems_heap_allocate_aligned_with_boundary(). Use rtems_heap_allocate_aligned_with_boundary() to avoid duplicated code.
2014-11-28libcsupport: Delete malloc statisticsSebastian Huber1-8/+2
Use the heap handler statistics instead. Add heap walk option to MALLOC shell command. close #1367
2014-11-25libcsupport: malloc_is_system_state_OK()Sebastian Huber1-2/+1
Move system state check to malloc_is_system_state_OK().
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2013-07-24score: Merge sysstate API into one fileSebastian Huber1-0/+2
2012-12-08libcsupport: Doxygen Enhancement Task #3Mathew Kallada1-2/+7
http://www.google-melange.com/gci/task/view/google/gci2012/7992210
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.
2010-08-252010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>Sebastian Huber1-4/+0
* libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_initialize.c: Remove heap walks in case RTEMS_DEBUG is defined.
2010-06-302010-06-30 Joel Sherrill <joel.sherrilL@OARcorp.com>Joel Sherrill1-9/+0
PR 1472/cpukit * libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h, libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_initialize.c, libcsupport/src/realloc.c, libcsupport/src/rtems_memalign.c: Remove malloc boundary code. It has not been used since before 4.6 and is bitrotted. * libcsupport/src/malloc_boundary.c: Removed.
2009-11-29Whitespace removal.Ralf Corsepius1-1/+1
2009-09-062009-09-06 Sebastian Huber <Sebastian.Huber@embedded-brains.de>Joel Sherrill1-2/+2
* 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.
2008-10-142008-10-14 Tim Cussins <timcussins@eml.cc>Joel Sherrill1-1/+1
* libcsupport/src/free.c: Should print begin field not start field.
2008-09-172008-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-4/+4
* libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_sbrk_helpers.c, libcsupport/src/malloc_statistics_helpers.c, libcsupport/src/malloc_walk.c, libcsupport/src/mallocfreespace.c, libcsupport/src/mallocinfo.c, libcsupport/src/realloc.c, libcsupport/src/rtems_memalign.c, sapi/include/confdefs.h, score/inline/rtems/score/thread.inl: Add support for optionally having a unified work area. In other words, the RTEMS Workspace and C Program Heap are the same pool of memory.
2008-09-01Convert using "bool".Ralf Corsepius1-1/+1
2008-01-092008-01-09 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-1/+1
* libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h, libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_deferred.c, libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_sbrk_helpers.c, libcsupport/src/posix_memalign.c: Place all deferred free code and place it in subroutines. Add plugin for dirtying allocated memory to assist in debugging. Clean up comments and spacing as needed. * libcsupport/src/malloc_dirtier.c: New file.
2007-12-192007-12-19 Joel Sherrill <joel.sherrill@OARcorp.com>Joel Sherrill1-4/+3
* libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h, libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_report_statistics_plugin.c, libmisc/shell/shell.c, libmisc/shell/shell.h, score/src/objectinitializeinformation.c: Add posix_memalign. Split out management of deferred frees to subroutines. * libcsupport/src/malloc_deferred.c, libcsupport/src/posix_memalign.c: New files.
2007-12-182007-12-18 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-0/+69
* libcsupport/Makefile.am, libcsupport/preinstall.am, libcsupport/src/malloc.c, libcsupport/src/mallocinfo.c, libmisc/Makefile.am, libmisc/shell/main_mallocinfo.c, libmisc/shell/shellconfig.h: Split malloc.c into multiple files with one function per file. Also split out statistics into a separate file which can be plugged in dynamically. Right now, it is always in. I suspect that splitting the file removed more code than leaving statistics in. I tinkered with malloc information command in the shell. I resurrected the malloc arena code as malloc boundary. This code is now compiled all the time even though it does not appear to work. * libcsupport/include/rtems/malloc.h, libcsupport/src/_calloc_r.c, libcsupport/src/_free_r.c, libcsupport/src/_malloc_r.c, libcsupport/src/_realloc_r.c, libcsupport/src/calloc.c, libcsupport/src/free.c, libcsupport/src/malloc_boundary.c, libcsupport/src/malloc_get_statistics.c, libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_report_statistics.c, libcsupport/src/malloc_report_statistics_plugin.c, libcsupport/src/malloc_statistics_helpers.c, libcsupport/src/malloc_walk.c, libcsupport/src/realloc.c, libmisc/shell/main_perioduse.c: New files.