Common up leak detection stuff which was previously duplicated in Memcheck
and Addrcheck.  In coregrind/vg_memory.c, create

   void VG_(generic_detect_memory_leaks

and remove several hundred lines of code from both ac_main.c and mc_main.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1250 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/include/vg_skin.h b/include/vg_skin.h
index 0494277..3d1fee4 100644
--- a/include/vg_skin.h
+++ b/include/vg_skin.h
@@ -1144,6 +1144,16 @@
 extern ThreadId VG_(any_matching_thread_stack)
                         ( Bool (*p) ( Addr stack_min, Addr stack_max ));
 
+/* Do memory leak detection. */
+extern void VG_(generic_detect_memory_leaks) (
+          Bool is_valid_64k_chunk ( UInt ),
+          Bool is_valid_address ( Addr ),
+          ExeContext* get_where ( ShadowChunk* ),
+          VgRes leak_resolution,
+          Bool  show_reachable
+       );
+
+
 /*====================================================================*/
 /*=== Skin-specific stuff                                          ===*/
 /*====================================================================*/