From 556702f86cb043f18bf46dceec25fe1e783c4590 Mon Sep 17 00:00:00 2001 From: Jeff Hostetler Date: Tue, 25 Jun 2019 07:49:40 -0700 Subject: msvc: add a compile-time flag to allow detailed heap debugging MS Visual C comes with a few neat features we can use to analyze the heap consumption (i.e. leaks, max memory, etc). With this patch, we introduce support via the build-time flag `USE_MSVC_CRTDBG`. Signed-off-by: Jeff Hostetler Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- config.mak.uname | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config.mak.uname') diff --git a/config.mak.uname b/config.mak.uname index b8c52e49d2..3fde48c64d 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -448,6 +448,10 @@ else endif BASIC_CFLAGS += $(sdk_libs) $(msvc_libs) +ifneq ($(USE_MSVC_CRTDBG),) + # Optionally enable memory leak reporting. + BASIC_CFLAGS += -DUSE_MSVC_CRTDBG +endif BASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=1 # Always give "-Zi" to the compiler and "-debug" to linker (even in # release mode) to force a PDB to be generated (like RelWithDebInfo). -- cgit v1.2.3