Skip to content

Commit 0c250e9

Browse files
committed
build: make Python memory allocations valgrind friendly
When testing with meson test -C .build --wrap='valgrind --leak-check=full' the Python binding will trigger 'Invalid read of size 4' warnings. Tell Python to use malloc directly for all memory allocation which can be properly traced by valgrind. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 4874da7 commit 0c250e9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

libnvme/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ if have_python_support
5555
test_env = environment()
5656
test_env.append('MALLOC_PERTURB_', '0')
5757
test_env.append('PYTHONPATH', join_paths(meson.current_build_dir(), '..'))
58+
test_env.append('PYTHONMALLOC', 'malloc')
5859

5960
# Test section
6061
test('[Python] import libnvme', python3, args: ['-c', 'from libnvme import nvme'], env: test_env)

0 commit comments

Comments
 (0)