[RTEMS Project] #4032: Make deferred free in malloc() support optional

RTEMS trac trac at rtems.org
Fri Jul 24 05:14:26 UTC 2020

#4032: Make deferred free in malloc() support optional
 Reporter:  Sebastian Huber  |       Owner:  Sebastian Huber
     Type:  enhancement      |      Status:  closed
 Priority:  normal           |   Milestone:  6.1
Component:  lib              |     Version:  6
 Severity:  normal           |  Resolution:  fixed
 Keywords:                   |  Blocked By:
 Blocking:                   |
Changes (by Sebastian Huber <sebastian.huber@…>):

 * status:  assigned => closed
 * resolution:   => fixed


 In [changeset:"7746b0def9787e9806f80a28efbe4c64d2b9e561/rtems"
 #!CommitTicketReference repository="rtems"
 malloc: Make deferred free support optional

 Only include the deferred free support if free() is actually used by the

 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.

Ticket URL: <http://devel.rtems.org/ticket/4032#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project

More information about the bugs mailing list