From 5853f708864c969cf930ad863fef4286865e0310 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 6 Jun 2021 16:38:14 +0200 Subject: mbuf: Add debugging helpers for allocation This adds a few helpers for debugging mbuf allocations when running in debugging mode (lsan, valgrind, etc.) - We do not want to cache allocations, so always set M_DOFREE to prevent us from putting any mbuf in it. - We want to update the mbuf allocation owner on function call for more precise leak reporting. Based on Jeremy Marchand's fuzzing work. Signed-off-by: jeremy marchand Signed-off-by: Samuel Thibault --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 19d6775..4407a77 100644 --- a/meson.build +++ b/meson.build @@ -72,6 +72,10 @@ cargs = [ '-DG_LOG_DOMAIN="Slirp"', ] +if cc.check_header('valgrind/valgrind.h') + cargs += [ '-DHAVE_VALGRIND=1' ] +endif + sources = [ 'src/arp_table.c', 'src/bootp.c', -- cgit v1.1