Changeset 690861c in rtems


Ignore:
Timestamp:
Nov 26, 2003, 5:50:53 PM (16 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
c9a4da01
Parents:
dfd3132
Message:

2003-11-26 Joel Sherrill <joel@…>

PR 523/filesystem

  • src/malloc.c: Make malloc family safer for use from ISRs and dispatching critical sections. If in a critical section while doing a free(), then the free is deferred until the next malloc() attempt.
Location:
cpukit/libcsupport
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/ChangeLog

    rdfd3132 r690861c  
     12003-11-26      Joel Sherrill <joel@OARcorp.com>
     2
     3        PR 523/filesystem
     4        * src/malloc.c: Make malloc family safer for use from ISRs and
     5        dispatching critical sections. If in a critical section while doing
     6        a free(), then the free is deferred until the next malloc() attempt.
     7
    182003-11-25      Jennifer Averett <jennifer@OARcorp.com>
    29
  • cpukit/libcsupport/src/malloc.c

    rdfd3132 r690861c  
    171171   */
    172172
    173   if (_Thread_Dispatch_disable_level > 0)
    174     return (void *) 0;
    175  
    176   if (_ISR_Nest_level > 0)
    177     return (void *) 0;
     173  if (_System_state_Is_up(_System_state_Get())) {
     174    if (_Thread_Dispatch_disable_level > 0)
     175      return (void *) 0;
     176 
     177    if (_ISR_Nest_level > 0)
     178      return (void *) 0;
     179  }
    178180 
    179181  /*
     
    298300   */
    299301
    300   if (_Thread_Dispatch_disable_level > 0)
    301     return (void *) 0;
    302  
    303   if (_ISR_Nest_level > 0)
    304     return (void *) 0;
     302  if (_System_state_Is_up(_System_state_Get())) {
     303    if (_Thread_Dispatch_disable_level > 0)
     304      return (void *) 0;
     305 
     306    if (_ISR_Nest_level > 0)
     307      return (void *) 0;
     308  }
    305309 
    306310  /*
     
    357361   */
    358362
    359   if ((_Thread_Dispatch_disable_level > 0) || (_ISR_Nest_level > 0)) {
    360     Chain_Append(&RTEMS_Malloc_GC_list, (Chain_Node *)ptr);
    361     return;
     363  if (_System_state_Is_up(_System_state_Get())) {
     364    if ((_Thread_Dispatch_disable_level > 0) || (_ISR_Nest_level > 0)) {
     365      Chain_Append(&RTEMS_Malloc_GC_list, (Chain_Node *)ptr);
     366      return;
     367    }
    362368  }
    363369 
Note: See TracChangeset for help on using the changeset viewer.