From 0c250e9d21270032e6af08c43ee1130b75a09fc3 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 11 Feb 2022 13:45:57 +0100 Subject: [PATCH] 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 --- libnvme/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/libnvme/meson.build b/libnvme/meson.build index e077fe68..cfed0e2a 100644 --- a/libnvme/meson.build +++ b/libnvme/meson.build @@ -55,6 +55,7 @@ if have_python_support test_env = environment() test_env.append('MALLOC_PERTURB_', '0') test_env.append('PYTHONPATH', join_paths(meson.current_build_dir(), '..')) + test_env.append('PYTHONMALLOC', 'malloc') # Test section test('[Python] import libnvme', python3, args: ['-c', 'from libnvme import nvme'], env: test_env)