#511 closed defect (fixed)

Defer free() while in dispatch critical section

Reported by: Joel Sherrill Owned by: Jennifer Averett
Priority: normal Milestone: 2
Component: fs Version: 4.6
Severity: major Keywords:
Cc: bugs@…, joel.sherrill@… Blocked By:
Blocking:

Description

If you attempt to malloc(), realloc(), free() from an ISR
or Thread Dispatching disabled critical section, then
very bad things can happen. This patch causes malloc()
and realloc() to fail when called at inappropriate times
and adds a deferred free() garbage collection list. Freeing
of blocks is deferred until the next malloc() invocation.

No solution is perfect but at least this keeps the burden
of the deferred frees in the context of a task which is
doing memory allocation anyway. At least all freed
memory should be in the heap before any mallocs
are allowed.

Release:
RTEMS-4.6 and trunk

Attachments (1)

malloc_gc.diff (2.6 KB) - added by Joel Sherrill on 12/03/06 at 13:31:12.
malloc_gc.diff

Download all attachments as: .zip

Change History (2)

comment:1 Changed on 10/22/03 at 15:54:38 by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: Patch applied to branch and trunk.

Changed on 12/03/06 at 13:31:12 by Joel Sherrill

Attachment: malloc_gc.diff added

malloc_gc.diff

Note: See TracTickets for help on using tickets.