Changeset cd792a86 in rtems
- Timestamp:
- 02/03/99 22:12:28 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 7c7fd4d
- Parents:
- 0747e2d
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/libtests/malloctest/system.h
r0747e2d rcd792a86 40 40 #define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3) 41 41 42 #define CONFIGURE_ EXTRA_TASK_STACKS (10 * RTEMS_MINIMUM_STACK_SIZE)42 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE 43 43 44 44 #include <confdefs.h> … … 46 46 /* global variables */ 47 47 48 TEST_EXTERN rtems_id Task_id[ 4]; /* array of task ids */49 TEST_EXTERN rtems_name Task_name[ 4]; /* array of task names */48 TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ 49 TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ 50 50 51 51 /* end of include file */ -
c/src/tests/libtests/malloctest/task1.c
r0747e2d rcd792a86 18 18 #include <libcsupport.h> /* for malloc_dump, malloc_walk */ 19 19 #include <string.h> /* for memset */ 20 #include <stdlib.h> 20 21 21 22 #define NUM_PASSES 100 … … 38 39 while (TRUE) 39 40 { 40 if ( passes++ > NUM_PASSES ) 41 if ( passes++ > NUM_PASSES ) { 42 puts("*** END OF MALLOC TEST ***"); 41 43 exit(0); 44 } 42 45 43 46 status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); … … 47 50 print_time( " - rtems_clock_get - ", &time, "\n" ); 48 51 49 mem_amt = rand() * task_number( tid ); 52 mem_amt = ((int)((float)rand()*1000.0/(float)RAND_MAX)); 53 while (!(mem_ptr = malloc ( mem_amt))) { 54 printf("out of memory... trying again.\n"); 55 mem_amt = ((int)((float)rand()*1000.0/(float)RAND_MAX)); 56 } 50 57 printf("mallocing %d bytes\n",mem_amt); 51 mem_ptr = malloc ( mem_amt);52 58 memset( mem_ptr, mem_amt, mem_amt ); 53 59 malloc_dump(); -
testsuites/libtests/malloctest/system.h
r0747e2d rcd792a86 40 40 #define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3) 41 41 42 #define CONFIGURE_ EXTRA_TASK_STACKS (10 * RTEMS_MINIMUM_STACK_SIZE)42 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE 43 43 44 44 #include <confdefs.h> … … 46 46 /* global variables */ 47 47 48 TEST_EXTERN rtems_id Task_id[ 4]; /* array of task ids */49 TEST_EXTERN rtems_name Task_name[ 4]; /* array of task names */48 TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ 49 TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ 50 50 51 51 /* end of include file */ -
testsuites/libtests/malloctest/task1.c
r0747e2d rcd792a86 18 18 #include <libcsupport.h> /* for malloc_dump, malloc_walk */ 19 19 #include <string.h> /* for memset */ 20 #include <stdlib.h> 20 21 21 22 #define NUM_PASSES 100 … … 38 39 while (TRUE) 39 40 { 40 if ( passes++ > NUM_PASSES ) 41 if ( passes++ > NUM_PASSES ) { 42 puts("*** END OF MALLOC TEST ***"); 41 43 exit(0); 44 } 42 45 43 46 status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); … … 47 50 print_time( " - rtems_clock_get - ", &time, "\n" ); 48 51 49 mem_amt = rand() * task_number( tid ); 52 mem_amt = ((int)((float)rand()*1000.0/(float)RAND_MAX)); 53 while (!(mem_ptr = malloc ( mem_amt))) { 54 printf("out of memory... trying again.\n"); 55 mem_amt = ((int)((float)rand()*1000.0/(float)RAND_MAX)); 56 } 50 57 printf("mallocing %d bytes\n",mem_amt); 51 mem_ptr = malloc ( mem_amt);52 58 memset( mem_ptr, mem_amt, mem_amt ); 53 59 malloc_dump();
Note: See TracChangeset
for help on using the changeset viewer.