39{
41 long long value[7];
43 double *m[7];
44
49
50 for (
i = 0;
i < 7;
i++ ) {
54
56 m[
i] = (
double * ) malloc(
ALLOCMEM *
sizeof (
double ) );
58 }
59
61 printf( "Test case: Dynamic Memory Information.\n" );
63 printf
64 ( "------------------------------------------------------------------------\n" );
65 for (
i = 0;
i < 7;
i++ )
66 printf( "Malloc additional: %d KB Memory Size in KB: %d\n",
67 (
int ) ( (
sizeof (
double ) *
ALLOCMEM ) / 1024 ),
69 printf
70 ( "------------------------------------------------------------------------\n" );
71 }
72 if ( value[6] >= value[5] && value[5] >= value[4] && value[4] >= value[3]
73 && value[3] >= value[2] && value[2] >= value[1] &&
74 value[1] >= value[0] )
76 else
77 test_fail( __FILE__, __LINE__,
"Calculating Resident Memory",
78 ( int ) value[6] );
79
80 return 1;
81}
Get information about the dynamic memory usage of the current program.
initialize the PAPI library.
static void dump_memory_info(FILE *output, PAPI_dmem_info_t *d)
void touch_dummy(double *array, int size)
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
A pointer to the following is passed to PAPI_get_dmem_info()