Changeset 07b93de in rtems


Ignore:
Timestamp:
Aug 10, 2010, 1:15:38 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
b50cde42
Parents:
bad5593
Message:

2010-08-10 Joel Sherrill <joel.sherrill@…>

PR 1661/testing

  • malloc04/init.c: Add public methods to get/set malloc heap pointer so the tests do not have to peer behind the API.
Location:
testsuites/libtests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/ChangeLog

    rbad5593 r07b93de  
     12010-08-10      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        PR 1661/testing
     4        * malloc04/init.c: Add public methods to get/set malloc heap pointer so
     5        the tests do not have to peer behind the API.
     6
    172010-08-09      Bharath Suri <bharath.s.jois@gmail.com>
    28
  • testsuites/libtests/malloc04/init.c

    rbad5593 r07b93de  
    1616#include <errno.h>
    1717
     18/* configuration information */
     19/* At top of file to have access to configuration variables */
     20
     21#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     22#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
     23
     24#define CONFIGURE_MAXIMUM_TASKS             1
     25#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
     26
     27#define CONFIGURE_INIT
     28#include <rtems/confdefs.h>
     29/* end of configuration */
     30
    1831char Malloc_Heap[ 128 ] CPU_STRUCTURE_ALIGNMENT;
    1932int sbrk_count;
    2033Heap_Control Heap_Holder;
     34Heap_Control TempHeap;
    2135
    2236/* Heap variables we need to peek and poke at */
    23 extern Heap_Control *RTEMS_Malloc_Heap;
    2437extern size_t  RTEMS_Malloc_Sbrk_amount;
    25 extern rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers;
    26 extern rtems_malloc_sbrk_functions_t  rtems_malloc_sbrk_helpers_table;
    2738
    2839size_t offset;
     
    5364{
    5465  void *p1, *p2, *p3, *p4;
     66  Heap_Control *TempHeap;
    5567
    5668  sbrk_count = 0;
     
    6072
    6173  /* Safe information on real heap */
    62   Heap_Holder = *RTEMS_Malloc_Heap;
     74  TempHeap = malloc_get_heap_pointer();
     75  Heap_Holder = *TempHeap;
    6376  rtems_malloc_sbrk_helpers = &rtems_malloc_sbrk_helpers_table;
    6477
     
    113126
    114127  /* Restore information on real heap */
    115   *RTEMS_Malloc_Heap = Heap_Holder;
     128  malloc_set_heap_pointer( TempHeap );
    116129  rtems_malloc_sbrk_helpers = NULL;
    117130
     
    121134}
    122135
    123 /* configuration information */
    124 
    125 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    126 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    127 
    128 #define CONFIGURE_MAXIMUM_TASKS             1
    129 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    130 
    131 #define CONFIGURE_INIT
    132 
    133 #include <rtems/confdefs.h>
    134136/* end of file */
Note: See TracChangeset for help on using the changeset viewer.