summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/malloc_deferred.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make zero size allocation result consistentSebastian Huber2021-05-041-4/+0
| | | | | | | | | | | | | | | | | | The zero size allocations had no consistent behaviour in RTEMS. For example, malloc( 0 ) returned NULL and posix_memalign( &p, align, 0 ) returned in p a unique pointer (or NULL if no memory is available). In POSIX, zero size memory allocations are implementation-defined behaviour. The implementation has two options: https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html Linux and FreeBSD return a unique pointer for zero size memory allocations. Use this approach for RTEMS as well throughout the memory allocation directives Close #4390.
* libcsupport: Move rtems_calloc()Sebastian Huber2021-04-201-15/+0
| | | | | | | | | Move rtems_calloc() since it only depends on rtems_malloc(). This may make it easier to customize the heap allocator. Change licence to BSD-2-Clause according to file history. Update #3053.
* malloc: Make deferred free support optionalSebastian Huber2020-07-241-37/+3
| | | | | | | | | | | | | | | | | | | | 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.
* Canonicalize config.h includeSebastian Huber2020-04-161-1/+1
| | | | | | | | Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
* Add rtems_malloc() and rtems_calloc()Sebastian Huber2018-11-121-0/+25
| | | | Close #3583.
* score: Add debug support to chainsSebastian Huber2016-07-221-1/+5
| | | | | | | This helps to detect * double insert, append, prepend errors, and * get from empty chain errors.
* malloc: Avoid memory leaks during task deleteSebastian Huber2016-04-061-1/+3
| | | | | Call _Malloc_Process_deferred_frees() owning the allocator lock to prevent deletion of the executing thread while doing the deferred frees.
* malloc: Fix early realloc() allocationSebastian Huber2016-04-061-1/+1
|
* malloc: Fix function definitionSebastian Huber2016-03-011-1/+1
| | | | Close #2617.
* malloc: Add _Malloc_System_state()Sebastian Huber2016-02-251-5/+63
| | | | | | | | | | 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.
* malloc: Use dedicated lock for deferred freesSebastian Huber2016-02-251-9/+26
|
* malloc: Clean up "malloc_p.h" header fileSebastian Huber2016-02-251-1/+1
|
* libcsupport: malloc_is_system_state_OK()Sebastian Huber2014-11-251-4/+3
| | | | Move system state check to malloc_is_system_state_OK().
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* Include missing <rtems/score/threaddispatch.h>Sebastian Huber2013-07-261-0/+2
|
* libcsupport: Do not use _ISR_Nest_levelSebastian Huber2013-07-181-3/+0
| | | | | The _Thread_Dispatch_is_enabled() is false if _ISR_Nest_level is not equal to zero.
* score: Add and use _Thread_Dispatch_is_enabled()Sebastian Huber2013-06-141-1/+1
| | | | | Delete _Thread_Dispatch_in_critical_section() and _Thread_Is_dispatching_enabled().
* libcsupport: GCI Doxygen Task #7Alex Ivanov2012-12-111-0/+7
| | | | http://www.google-melange.com/gci/task/view/google/gci2012/7975223
* libcsupport: malloc_deferred_frees_initialize()Sebastian Huber2012-10-251-6/+1
| | | | Remove this function and statically initialize RTEMS_Malloc_GC_list.
* Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill2012-05-111-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.
* 2011-04-21 Jennifer Averett <Jennifer.Averett@OARcorp.comJennifer Averett2011-04-211-1/+1
| | | | | | | | | | | | | PR 1777/cpukit * libcsupport/src/malloc_deferred.c, libcsupport/src/realloc.c, score/Makefile.am, score/cpu/lm32/irq.c, score/cpu/nios2/irq.c, score/include/rtems/score/coremutex.h, score/include/rtems/score/thread.h, score/inline/rtems/score/thread.inl, score/src/heapfree.c, score/src/pheapwalk.c, score/src/smp.c, score/src/threaddispatch.c: Consolidated access to _Thread_Dispatch_disable_level. * score/src/threaddisabledispatch.c, score/src/threadenabledispatch.c: New files.
* Convert using "bool".Ralf Corsepius2008-09-011-4/+4
|
* 2008-07-03 Chris Johns <chrisj@rtems.org>Chris Johns2008-07-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cpukit/libcsupport/include/chain.h: Removed. Use the SAPI interface that is supported. * cpukit/libcsupport/Makefile.am, cpukit/libcsupport/preinstall.am: Remove chain.h header references. * cpukit/sapi/include/rtems/chain.h, cpukit/sapi/inline/rtems/chain.inl: New. A supported chains interface. * cpukit/sapi/Makefile.am, cpukit/sapi/preinstall.am: Updated to include the new chains interface. * cpukit/libfs/src/imfs/imfs.h, cpukit/libfs/src/imfs/imfs_creat.c, cpukit/libfs/src/imfs/imfs_debug.c, cpukit/libfs/src/imfs/imfs_directory.c, cpukit/libfs/src/imfs/imfs_fsunmount.c, cpukit/libfs/src/imfs/imfs_getchild.c, cpukit/libfs/src/imfs/imfs_load_tar.c, cpukit/libfs/src/imfs/imfs_rmnod.c, cpukit/libfs/src/imfs/memfile.c, cpukit/libfs/src/nfsclient/src/nfs.c, cpukit/libcsupport/include/rtems/libio.h, cpukit/libcsupport/src/malloc_deferred.c, cpukit/libcsupport/src/mount.c, cpukit/libcsupport/src/privateenv.c, cpukit/libcsupport/src/unmount.c: Change to the new chains interface. * cpukit/libcsupport/src/malloc_boundary.c: Remove warning.
* 2008-01-09 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill2008-01-091-2/+9
| | | | | | | | | | | | * 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-19 Joel Sherrill <joel.sherrill@OARcorp.com>Joel Sherrill2007-12-191-0/+53
* 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.