Changeset 0806f85 in rtems


Ignore:
Timestamp:
Apr 24, 2013, 7:21:57 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
3771f3cc
Parents:
ad8010c
git-author:
Sebastian Huber <sebastian.huber@…> (04/24/13 07:21:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/26/13 08:57:07)
Message:

libcsupport: Delete REENT_MALLOCED define

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/newlibc_reent.c

    rad8010c r0806f85  
    4949
    5050extern struct _reent * const _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__;
    51 /*
    52  * reent struct allocation moved here from libc_start_hook() to avoid
    53  * mutual exclusion problems when memory is allocated from the start hook.
    54  *
    55  * Memory is also now allocated from the workspace rather than the heap.
    56  *  -- ptorre 9/30/03
    57  */
     51
    5852bool newlib_create_hook(
    5953  rtems_tcb *current_task __attribute__((unused)),
     
    7064  }
    7165
    72   /*  NOTE: The RTEMS malloc is reentrant without a reent ptr since
    73    *        it is based on the Classic API Region Manager.
     66  /* It is OK to allocate from the workspace because these
     67   * hooks run with thread dispatching disabled.
    7468   */
    75 
    76   #define REENT_MALLOCED 0
    77   #if REENT_MALLOCED
    78     ptr = (struct _reent *) calloc(1, sizeof(struct _reent));
    79   #else
    80     /* It is OK to allocate from the workspace because these
    81      * hooks run with thread dispatching disabled.
    82      */
    83     ptr = (struct _reent *) _Workspace_Allocate(sizeof(struct _reent));
    84   #endif
     69  ptr = (struct _reent *) _Workspace_Allocate(sizeof(struct _reent));
    8570
    8671  if (ptr) {
     
    136121  struct _reent *ptr;
    137122
    138   /*
    139    * The reentrancy structure was allocated by newlib using malloc()
    140    */
    141 
    142123  if (current_task == deleted_task) {
    143124    ptr = _REENT;
     
    155136     */
    156137    _fwalk(ptr, newlib_free_buffers);
    157 #if REENT_MALLOCED
    158     free(ptr);
    159 #else
     138
    160139    _Workspace_Free(ptr);
    161 #endif
    162140  }
    163141
Note: See TracChangeset for help on using the changeset viewer.