Commit | Line | Data |
---|---|---|
49636689 JD |
1 | This document describes some principles that should be respected when |
2 | developing in Babeltrace. | |
3 | ||
4 | Memory usage : | |
6aa249b5 | 5 | |
49636689 JD |
6 | Since Babeltrace exports a library, we need to make sure that all allocated |
7 | memory is freed, we do not want any memory leaks. | |
8 | Since Babeltrace uses the glib, it is necessary to assist a little valgrind | |
9 | when trying to identify memory leaks. | |
6aa249b5 MD |
10 | |
11 | libpopt has issues with inconsistency between versions. Namely, libpopt | |
12 | 0.16 allocates memory for the string returned by poptgetArg(), but not | |
13 | libpopt 0.13. Therefore, we are providing a warning suppression file | |
14 | that covers this case in the extras/ directory of the source code. | |
15 | ||
49636689 | 16 | So the proper invocation of Babeltrace with Valgrind is : |
6aa249b5 MD |
17 | |
18 | G_SLICE=always-malloc G_DEBUG=gc-friendly \ | |
19 | valgrind --leak-check=full \ | |
20 | --suppressions=path_to_babeltrace_src/extras/valgrind/popt.supp \ | |
21 | babeltrace |