Index: trunk/include/iprt/mangling.h
===================================================================
--- trunk/include/iprt/mangling.h	(revision 36596)
+++ trunk/include/iprt/mangling.h	(revision 36597)
@@ -747,4 +747,18 @@
 # define RTMemTmpAllocZTag                              RT_MANGLER(RTMemTmpAllocZTag)
 # define RTMemTmpFree                                   RT_MANGLER(RTMemTmpFree)
+# define RTMemTrackerDumpAllToFile                      RT_MANGLER(RTMemTrackerDumpAllToFile)
+# define RTMemTrackerDumpAllToLog                       RT_MANGLER(RTMemTrackerDumpAllToLog)
+# define RTMemTrackerDumpAllToLogRel                    RT_MANGLER(RTMemTrackerDumpAllToLogRel)
+# define RTMemTrackerDumpAllToStdErr                    RT_MANGLER(RTMemTrackerDumpAllToStdErr)
+# define RTMemTrackerDumpAllToStdOut                    RT_MANGLER(RTMemTrackerDumpAllToStdOut)
+# define RTMemTrackerDumpStatsToFile                    RT_MANGLER(RTMemTrackerDumpStatsToFile)
+# define RTMemTrackerDumpStatsToLog                     RT_MANGLER(RTMemTrackerDumpStatsToLog)
+# define RTMemTrackerDumpStatsToLogRel                  RT_MANGLER(RTMemTrackerDumpStatsToLogRel)
+# define RTMemTrackerDumpStatsToStdErr                  RT_MANGLER(RTMemTrackerDumpStatsToStdErr)
+# define RTMemTrackerDumpStatsToStdOut                  RT_MANGLER(RTMemTrackerDumpStatsToStdOut)
+# define RTMemTrackerHdrAlloc                           RT_MANGLER(RTMemTrackerHdrAlloc)
+# define RTMemTrackerHdrFree                            RT_MANGLER(RTMemTrackerHdrFree)
+# define RTMemTrackerHdrReallocDone                     RT_MANGLER(RTMemTrackerHdrReallocDone)
+# define RTMemTrackerHdrReallocPrep                     RT_MANGLER(RTMemTrackerHdrReallocPrep)
 # define RTMemWipeThoroughly                            RT_MANGLER(RTMemWipeThoroughly)
 # define RTMpCpuId                                      RT_MANGLER(RTMpCpuId)
@@ -1386,5 +1400,8 @@
 # define RTThreadGetType                                RT_MANGLER(RTThreadGetType)
 # define RTThreadIsInInterrupt                          RT_MANGLER(RTThreadIsInInterrupt)      /* r0drv */
+# define RTThreadIsInitialized                          RT_MANGLER(RTThreadIsInitialized)
 # define RTThreadIsMain                                 RT_MANGLER(RTThreadIsMain)
+# define RTThreadIsSelfAlive                            RT_MANGLER(RTThreadIsSelfAlive)
+# define RTThreadIsSelfKnown                            RT_MANGLER(RTThreadIsSelfKnown)
 # define RTThreadNativeSelf                             RT_MANGLER(RTThreadNativeSelf)
 # define RTThreadPoke                                   RT_MANGLER(RTThreadPoke) /* not-win not-os2 */
Index: trunk/include/iprt/memtracker.h
===================================================================
--- trunk/include/iprt/memtracker.h	(revision 36596)
+++ trunk/include/iprt/memtracker.h	(revision 36597)
@@ -46,5 +46,7 @@
     RTMEMTRACKERMETHOD_ALLOC,
     RTMEMTRACKERMETHOD_ALLOCZ,
-    RTMEMTRACKERMETHOD_REALLOC,
+    RTMEMTRACKERMETHOD_REALLOC_PREP,   /**< Internal, don't use. */
+    RTMEMTRACKERMETHOD_REALLOC_DONE,   /**< Internal, don't use. */
+    RTMEMTRACKERMETHOD_REALLOC_FAILED, /**< Internal, don't use. */
     RTMEMTRACKERMETHOD_FREE,
 
@@ -60,4 +62,7 @@
 typedef struct RTMEMTRACKERTAG *PRTMEMTRACKERTAG;
 
+/** Pointer to a user structure. */
+typedef struct RTMEMTRACKERUSER *PRTMEMTRACKERUSER;
+
 /**
  * Memory Tracking Header for use with RTMemTrackerHdrAlloc,
@@ -69,22 +74,37 @@
     /** Magic value / eye catcher (RTMEMTRACKERHDR_MAGIC). */
     size_t              uMagic;
-    /** The allocation size.  */
-    size_t              cbSize;
+    /** The allocation size, user data only.  */
+    size_t              cbUser;
     /** The list entry. */
     RTLISTNODE          ListEntry;
+    /** Pointer to the user structure where this header is linked. */
+    PRTMEMTRACKERUSER   pUser;
+    /** Pointer to the per-tag structure. */
+    PRTMEMTRACKERTAG    pTag;
     /** The tag string. */
     const char         *pszTag;
-    /** Pointer to the per-tag structure. */
-    PRTMEMTRACKERTAG    pTag;
-    /** Alignmnet padding. */
-    void               *pvAlignment[2];
+    /** Pointer to the user data we're tracking. */
+    void               *pvUser;
 } RTMEMTRACKERHDR;
+/** Pointer to a memory tracker header. */
+typedef RTMEMTRACKERHDR *PRTMEMTRACKERHDR;
+/** Pointer to a const memory tracker header. */
+typedef RTMEMTRACKERHDR *PPRTMEMTRACKERHDR;
 
 /** Magic value for RTMEMTRACKERHDR::uMagic (Kelly Link). */
 #if ARCH_BITS == 64
-# define RTMEMTRACKERHDR_MAGIC   UINT64_C(0x1907691919690719)
+# define RTMEMTRACKERHDR_MAGIC          UINT64_C(0x1907691919690719)
 #else
-# define RTMEMTRACKERHDR_MAGIC   UINT32_C(0x19690719)
+# define RTMEMTRACKERHDR_MAGIC          UINT32_C(0x19690719)
 #endif
+/** Magic number used when reallocated. */
+#if ARCH_BITS == 64
+# define RTMEMTRACKERHDR_MAGIC_REALLOC  UINT64_C(0x0000691919690000)
+#else
+# define RTMEMTRACKERHDR_MAGIC_REALLOC  UINT32_C(0x19690000)
+#endif
+/** Magic number used when freed. */
+#define RTMEMTRACKERHDR_MAGIC_FREE      (~RTMEMTRACKERHDR_MAGIC)
+
 
 /**
@@ -94,9 +114,9 @@
  * @param   pv                  The header + user data block.  This must be at
  *                              least @a cb + sizeof(RTMEMTRACKERHDR).
- * @param   cb                  The user data size (bytes).
+ * @param   cbUser              The user data size (bytes).
  * @param   pszTag              The tag string.
  * @param   enmMethod           The method that the user called.
  */
-RTDECL(void *) RTMemTrackerHdrAlloc(void *pv, size_t cb, const char *pszTag, RTMEMTRACKERMETHOD enmMethod);
+RTDECL(void *) RTMemTrackerHdrAlloc(void *pv, size_t cbUser, const char *pszTag, RTMEMTRACKERMETHOD enmMethod);
 
 /**
@@ -104,10 +124,10 @@
  *
  * @returns Pointer to the user data part.
- * @param   pvOld               Pointer to the old user data.
- * @param   cbOld               The size of the old user data, 0 if not known.
- * @param   pszTag              The tag string.
- * @param   enmMethod           The method that the user called.
- */
-RTDECL(void *) RTMemTrackerHdrReallocPrep(void *pvOld, size_t cbOld, const char *pszTag, RTMEMTRACKERMETHOD enmMethod);
+ * @param   pvOldUser           Pointer to the old user data.
+ * @param   cbOldUser           The size of the old user data, 0 if not
+ *                              known.
+ * @param   pszTag              The tag string.
+ */
+RTDECL(void *) RTMemTrackerHdrReallocPrep(void *pvOldUser, size_t cbOldUser, const char *pszTag);
 
 /**
@@ -119,24 +139,23 @@
  *                              this is NULL, we assume the realloc() call
  *                              failed.
- * @param   cbNew               The user data size (bytes).
- * @param   pvOld               Pointer to the old user data.  This is only
+ * @param   cbNewUser           The user data size (bytes).
+ * @param   pvOldUser           Pointer to the old user data.  This is only
  *                              valid on failure of course and used to bail out
  *                              in that case.  Should not be NULL.
  * @param   pszTag              The tag string.
+ */
+RTDECL(void *) RTMemTrackerHdrReallocDone(void *pvNew, size_t cbNewUser, void *pvOldUser, const char *pszTag);
+
+
+/**
+ * Do the accounting on free.
+ *
+ * @returns @a pv.
+ * @param   pvUser              Pointer to the user data.
+ * @param   cbUser              The size of the user data, 0 if not known.
+ * @param   pszTag              The tag string.
  * @param   enmMethod           The method that the user called.
  */
-RTDECL(void *) RTMemTrackerHdrReallocDone(void *pvNew, size_t cbNew, void *pvOld, const char *pszTag, RTMEMTRACKERMETHOD enmMethod);
-
-
-/**
- * Do the accounting on free.
- *
- * @returns @a pv.
- * @param   pv                  Pointer to the user data.
- * @param   cb                  The size of the user data, 0 if not known.
- * @param   pszTag              The tag string.
- * @param   enmMethod           The method that the user called.
- */
-RTDECL(void *) RTMemTrackerHdrFree(void *pv, size_t cb, const char *pszTag, RTMEMTRACKERMETHOD enmMethod);
+RTDECL(void *) RTMemTrackerHdrFree(void *pvUser, size_t cbUser, const char *pszTag, RTMEMTRACKERMETHOD enmMethod);
 
 
@@ -149,5 +168,5 @@
  * Dumps all the allocations and tag statistics to the release log.
  */
-RTDECL(void) RTMemTrackerDumpAllToRelLog(void);
+RTDECL(void) RTMemTrackerDumpAllToLogRel(void);
 
 /**
@@ -169,26 +188,42 @@
 /**
  * Dumps all the tag statistics to the log.
- */
-RTDECL(void) RTMemTrackerDumpStatsToLog(void);
+ *
+ * @param   fVerbose        Whether to print all the stats or just the ones
+ *                          relevant to hunting leaks.
+ */
+RTDECL(void) RTMemTrackerDumpStatsToLog(bool fVerbose);
 
 /**
  * Dumps all the tag statistics to the release log.
- */
-RTDECL(void) RTMemTrackerDumpStatsToRelLog(void);
+ *
+ * @param   fVerbose        Whether to print all the stats or just the ones
+ *                          relevant to hunting leaks.
+ */
+RTDECL(void) RTMemTrackerDumpStatsToLogRel(bool fVerbose);
 
 /**
  * Dumps all the tag statistics to standard out.
- */
-RTDECL(void) RTMemTrackerDumpStatsToStdOut(void);
+ *
+ * @param   fVerbose        Whether to print all the stats or just the ones
+ *                          relevant to hunting leaks.
+ */
+RTDECL(void) RTMemTrackerDumpStatsToStdOut(bool fVerbose);
 
 /**
  * Dumps all the tag statistics to standard err.
- */
-RTDECL(void) RTMemTrackerDumpStatsToStdErr(void);
+ *
+ * @param   fVerbose        Whether to print all the stats or just the ones
+ *                          relevant to hunting leaks.
+ */
+RTDECL(void) RTMemTrackerDumpStatsToStdErr(bool fVerbose);
 
 /**
  * Dumps all the tag statistics to the specified filename.
- */
-RTDECL(void) RTMemTrackerDumpStatsToFile(const char *pszFilename);
+ *
+ * @param   fVerbose        Whether to print all the stats or just the ones
+ *                          relevant to hunting leaks.
+ * @param   pszFilename         The name of the file to dump to.
+ */
+RTDECL(void) RTMemTrackerDumpStatsToFile(bool fVerbose, const char *pszFilename);
 
 
