PAPI
7.1.0.0
Loading...
Searching...
No Matches
memleak_check.c
Go to the documentation of this file.
1
// This is a simple minimal test for memory leaks.
2
// This is automatically compiled with -g (including debug info).
3
// Execute: valgrind --leak-check=yes ./memleak_check
4
// You can modify this program to check for leaks in specific
5
// operations, as necessary.
6
7
#include <
papi.h
>
8
9
int
main
(
int
argv,
char
**argc) {
10
(void) argv;
// prevent warning for not-used.
11
(void) argc;
// prevent warning for not-used.
12
13
int
retval
=
PAPI_library_init
(
PAPI_VER_CURRENT
);
// This does several allocations.
14
(void)
retval
;
// prevent warning for not-used.
15
16
PAPI_shutdown
();
// Shutdown should release them all.
17
return
(0);
18
}
// end main()
PAPI_library_init
initialize the PAPI library.
PAPI_shutdown
Finish using PAPI and free all related resources.
PAPI_VER_CURRENT
#define PAPI_VER_CURRENT
Definition:
f90papi.h:54
papi.h
Return codes and api definitions.
main
int main()
Definition:
pernode.c:20
retval
int retval
Definition:
zero_fork.c:53
src
validation_tests
memleak_check.c
Generated on Wed Dec 20 2023 18:12:52 for PAPI by
1.9.6