File: memleak_check.c

package info (click to toggle)
papi 5.7.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,856 kB
  • sloc: ansic: 93,265; fortran: 3,338; xml: 2,460; makefile: 815; sh: 290
file content (18 lines) | stat: -rw-r--r-- 793 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// This is a simple minimal test for memory leaks.
// This is automatically compiled with -g (including debug info).
// Execute: valgrind --leak-check=yes ./memleak_check 
// You can modify this program to check for leaks in specific 
// operations, as necessary. 

#include <papi.h>

int main(int argv, char **argc) {
   (void) argv;                                       // prevent warning for not-used.
   (void) argc;                                       // prevent warning for not-used.

   int retval = PAPI_library_init(PAPI_VER_CURRENT);  // This does several allocations.
   (void) retval;                                     // prevent warning for not-used.

   PAPI_shutdown();                                   // Shutdown should release them all. 
   return(0);
} // end main()