Changeset be8bdff in rtems


Ignore:
Timestamp:
Jul 14, 2010, 4:03:57 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
fa126921
Parents:
16d1bd3
Message:

2010-07-14 Joel Sherrill <joel.sherrill@…>

  • support/include/test_support.h, support/src/test_support.c: Add Allocate_majority_of_heap().
Location:
testsuites
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/ChangeLog

    r16d1bd3 rbe8bdff  
     12010-07-14      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * support/include/test_support.h, support/src/test_support.c: Add
     4        Allocate_majority_of_heap().
     5
    162010-06-25      Joel Sherrill <joel.sherrilL@OARcorp.com>
    27
  • testsuites/support/include/test_support.h

    r16d1bd3 rbe8bdff  
    11/*
    2  *  COPYRIGHT (c) 1989-2009.
     2 *  COPYRIGHT (c) 1989-2010.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    1818
    1919/*
     20 *  Allocate a number of small blocks from the workspace
     21 *  until the largest free block of memory available is
     22 *  smaller than smallest.
     23 *
     24 *  NOTE: The memory CANNOT be freed.
     25 */
     26void Allocate_majority_of_workspace( int smallest );
     27
     28/*
    2029 *  Allocate a number of small blocks from the heap
    2130 *  until the largest free block of memory available is
     
    2433 *  NOTE: The memory CANNOT be freed.
    2534 */
    26 void Allocate_majority_of_workspace( int smallest );
     35void Allocate_majority_of_heap( int smallest );
    2736
    2837/*
  • testsuites/support/src/test_support.c

    r16d1bd3 rbe8bdff  
    11/*
    2  *  COPYRIGHT (c) 1989-2009.
     2 *  COPYRIGHT (c) 1989-2010.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    1313#include <tmacros.h>
    1414#include "test_support.h"
     15#include <rtems/libcsupport.h>
    1516
    1617static char  Too_Long_Name[PATH_MAX + 2];
     
    5960
    6061}
     62
     63void Allocate_majority_of_heap( int smallest )
     64{
     65  size_t    size;
     66  void     *temp;
     67
     68  puts("Allocate_majority_of_heap: ");
     69  size = malloc_free_space();
     70  do {
     71    temp = malloc( size-16 );
     72    if (!temp)
     73      perror("Unable to allocate from workspace");
     74    size = malloc_free_space();
     75  } while ( size >= smallest );
     76
     77}
Note: See TracChangeset for help on using the changeset viewer.