Changeset 635865ae in rtems


Ignore:
Timestamp:
Jan 9, 2008, 9:08:36 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
bfc54b0
Parents:
b9e23917
Message:

2008-01-09 Joel Sherrill <joel.sherrill@…>

  • 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.
Location:
cpukit
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rb9e23917 r635865ae  
     12008-01-09      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h,
     4        libcsupport/src/free.c, libcsupport/src/malloc.c,
     5        libcsupport/src/malloc_deferred.c,
     6        libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h,
     7        libcsupport/src/malloc_sbrk_helpers.c,
     8        libcsupport/src/posix_memalign.c: Place all deferred free code and
     9        place it in subroutines. Add plugin for dirtying allocated memory to
     10        assist in debugging. Clean up comments and spacing as needed.
     11        * libcsupport/src/malloc_dirtier.c: New file.
     12
    1132008-01-09      Joel Sherrill <joel.sherrill@OARcorp.com>
    214
  • cpukit/libcsupport/src/free.c

    rb9e23917 r635865ae  
    3939  if ( _System_state_Is_up(_System_state_Get()) &&
    4040       !malloc_is_system_state_OK() ) {
    41       malloc_defer_free(ptr);
     41      malloc_deferred_free(ptr);
    4242      return;
    4343  }
  • cpukit/libcsupport/src/malloc.c

    rb9e23917 r635865ae  
    2828{
    2929  void        *return_this;
    30   Chain_Node  *to_be_freed;
    3130
    3231  MSBUMP(malloc_calls, 1);
     
    3534   *  If some free's have been deferred, then do them now.
    3635   */
    37   malloc_process_deferred_frees();
     36  malloc_deferred_frees_process();
    3837
    3938  /*
     
    8685   *  If the user wants us to dirty the allocated memory, then do it.
    8786   */
    88   #ifdef MALLOC_DIRTY
    89     (void) memset(return_this, 0xCF, size);
    90   #endif
     87  if ( rtems_malloc_dirty_helper )
     88    (*rtems_malloc_dirty_helper)( return_this, size );
    9189
    9290  /*
  • cpukit/libcsupport/src/malloc_deferred.c

    rb9e23917 r635865ae  
    2323#include "malloc_p.h"
    2424
     25Chain_Control RTEMS_Malloc_GC_list;
     26
    2527boolean malloc_is_system_state_OK(void)
    2628{
     
    3436}
    3537
    36 void malloc_process_deferred_frees(void)
     38void malloc_deferred_frees_initialize(void)
     39{
     40  Chain_Initialize_empty(&RTEMS_Malloc_GC_list);
     41}
     42
     43void malloc_deferred_frees_process(void)
    3744{
    3845  Chain_Node  *to_be_freed;
     
    4552}
    4653
    47 void malloc_defer_free(
     54void malloc_deferred_free(
    4855  void *pointer
    4956)
  • cpukit/libcsupport/src/malloc_initialize.c

    rb9e23917 r635865ae  
    2222
    2323Heap_Control              RTEMS_Malloc_Heap;
    24 Chain_Control             RTEMS_Malloc_GC_list;
    2524rtems_malloc_statistics_t rtems_malloc_statistics;
    2625
     
    5150   *  Initialize the garbage collection list to start with nothing on it.
    5251   */
    53   Chain_Initialize_empty(&RTEMS_Malloc_GC_list);
     52  malloc_deferred_frees_initialize();
    5453
    5554  starting_address = start;
  • cpukit/libcsupport/src/malloc_p.h

    rb9e23917 r635865ae  
    3939 */
    4040extern Heap_Control  RTEMS_Malloc_Heap;
    41 extern Chain_Control RTEMS_Malloc_GC_list;
    4241
    4342/*
     
    4948
    5049/*
    51  *  Dirty memory plugin
    52  */
    53 #define MALLOC_DIRTY
    54 
    55 /*
    5650 *  Process deferred free operations
    5751 */
    5852boolean malloc_is_system_state_OK(void);
    59 void malloc_process_deferred_frees(void);
     53void malloc_deferred_frees_initialize(void);
     54void malloc_deferred_frees_process(void);
    6055void malloc_defer_free(void *);
  • cpukit/libcsupport/src/malloc_sbrk_helpers.c

    rb9e23917 r635865ae  
    11/*
    2  *  RTEMS Malloc Family Implementation --Initialization
    3  *
     2 *  RTEMS Malloc -- SBRK Support Plugin
    43 *
    54 *  COPYRIGHT (c) 1989-2007.
  • cpukit/libcsupport/src/posix_memalign.c

    rb9e23917 r635865ae  
    6060   *  If some free's have been deferred, then do them now.
    6161   */
    62   malloc_process_deferred_frees();
     62  malloc_deferred_frees_process();
    6363
    6464  #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
Note: See TracChangeset for help on using the changeset viewer.