diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-14 16:03:57 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-14 16:03:57 +0000 |
commit | be8bdff62b84dbb9e06c3491007038ecb74ec6c5 (patch) | |
tree | 4c05ace52498b1ca4d2579e438cdb81d8fb10b89 /testsuites/support/src/test_support.c | |
parent | 16d1bd349b0f0381525add66b1534b86db697d12 (diff) |
2010-07-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* support/include/test_support.h, support/src/test_support.c: Add
Allocate_majority_of_heap().
Diffstat (limited to '')
-rw-r--r-- | testsuites/support/src/test_support.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/testsuites/support/src/test_support.c b/testsuites/support/src/test_support.c index e71700aec4..319be6f17b 100644 --- a/testsuites/support/src/test_support.c +++ b/testsuites/support/src/test_support.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2010. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -12,6 +12,7 @@ #include <fcntl.h> #include <tmacros.h> #include "test_support.h" +#include <rtems/libcsupport.h> static char Too_Long_Name[PATH_MAX + 2]; static char Longest_Name[PATH_MAX + 1]; @@ -58,3 +59,19 @@ void Allocate_majority_of_workspace( int smallest ) } while ( info.Free.largest >= smallest ); } + +void Allocate_majority_of_heap( int smallest ) +{ + size_t size; + void *temp; + + puts("Allocate_majority_of_heap: "); + size = malloc_free_space(); + do { + temp = malloc( size-16 ); + if (!temp) + perror("Unable to allocate from workspace"); + size = malloc_free_space(); + } while ( size >= smallest ); + +} |