Index: trunk/src/VBox/Runtime/common/string/straprintf.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/string/straprintf.cpp	(revision 30859)
+++ trunk/src/VBox/Runtime/common/string/straprintf.cpp	(revision 31157)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -43,14 +43,16 @@
 {
     /** Pointer to current buffer position. */
-    char   *psz;
+    char       *psz;
     /** Number of bytes left in the buffer - not including the trailing zero. */
-    size_t  cch;
+    size_t      cch;
     /** Pointer to the start of the buffer. */
-    char   *pszBuffer;
+    char       *pszBuffer;
     /** The number of bytes in the buffer. */
-    size_t  cchBuffer;
+    size_t      cchBuffer;
     /** Set if the buffer was allocated using RTMemRealloc(). If clear
      * pszBuffer points to the initial stack buffer. */
-    bool    fAllocated;
+    bool        fAllocated;
+    /** Allocation tag used for statistics and such. */
+    const char *pszTag;
 } STRALLOCARG;
 /** Pointer to a strallocoutput() argument structure. */
@@ -100,5 +102,6 @@
         if (cbAdded <= _1G)
         {
-            char *pszBuffer = (char *)RTMemRealloc(pArg->fAllocated ? pArg->pszBuffer : NULL, cbAdded + pArg->cchBuffer);
+            char *pszBuffer = (char *)RTMemReallocTag(pArg->fAllocated ? pArg->pszBuffer : NULL,
+                                                      cbAdded + pArg->cchBuffer, pArg->pszTag);
             if (pszBuffer)
             {
@@ -135,5 +138,5 @@
 
 
-RTDECL(int) RTStrAPrintfV(char **ppszBuffer, const char *pszFormat, va_list args)
+RTDECL(int) RTStrAPrintfVTag(char **ppszBuffer, const char *pszFormat, va_list args, const char *pszTag)
 {
     char            szBuf[2048];
@@ -144,4 +147,5 @@
     Arg.cch         = sizeof(szBuf) - 1;
     Arg.psz         = szBuf;
+    Arg.pszTag      = pszTag;
     szBuf[0] = '\0';
     int cbRet = (int)RTStrFormatV(strallocoutput, &Arg, NULL, NULL, pszFormat, args);
@@ -152,5 +156,5 @@
             /* duplicate the string in szBuf */
             Assert(Arg.pszBuffer == szBuf);
-            char *psz = (char *)RTMemAlloc(cbRet + 1);
+            char *psz = (char *)RTMemAllocTag(cbRet + 1, pszTag);
             if (psz)
                 memcpy(psz, szBuf, cbRet + 1);
@@ -160,5 +164,5 @@
         {
             /* adjust the allocated buffer */
-            char *psz = (char *)RTMemRealloc(Arg.pszBuffer, cbRet + 1);
+            char *psz = (char *)RTMemReallocTag(Arg.pszBuffer, cbRet + 1, pszTag);
             *ppszBuffer = psz ? psz : Arg.pszBuffer;
         }
@@ -177,38 +181,13 @@
     return cbRet;
 }
-RT_EXPORT_SYMBOL(RTStrAPrintfV);
+RT_EXPORT_SYMBOL(RTStrAPrintfVTag);
 
 
-RTDECL(int) RTStrAPrintf(char **ppszBuffer, const char *pszFormat, ...)
-{
-    va_list args;
-    va_start(args, pszFormat);
-    int cbRet = RTStrAPrintfV(ppszBuffer, pszFormat, args);
-    va_end(args);
-    return cbRet;
-}
-RT_EXPORT_SYMBOL(RTStrAPrintf);
-
-
-RTDECL(char *) RTStrAPrintf2V(const char *pszFormat, va_list args)
+RTDECL(char *) RTStrAPrintf2VTag(const char *pszFormat, va_list args, const char *pszTag)
 {
     char *pszBuffer;
-    RTStrAPrintfV(&pszBuffer, pszFormat, args);
+    RTStrAPrintfVTag(&pszBuffer, pszFormat, args, pszTag);
     return pszBuffer;
 }
-RT_EXPORT_SYMBOL(RTStrAPrintf2V);
+RT_EXPORT_SYMBOL(RTStrAPrintf2VTag);
 
-
-RTDECL(char *) RTStrAPrintf2(const char *pszFormat, ...)
-{
-    va_list va;
-    char   *pszBuffer;
-
-    va_start(va, pszFormat);
-    RTStrAPrintfV(&pszBuffer, pszFormat, va);
-    va_end(va);
-
-    return pszBuffer;
-}
-RT_EXPORT_SYMBOL(RTStrAPrintf2);
-
Index: trunk/src/VBox/Runtime/common/string/stringalloc.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/string/stringalloc.cpp	(revision 30859)
+++ trunk/src/VBox/Runtime/common/string/stringalloc.cpp	(revision 31157)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -40,17 +40,17 @@
 
 
-RTDECL(char *) RTStrAlloc(size_t cb)
-{
-    char *psz = (char *)RTMemAlloc(RT_MAX(cb, 1));
+RTDECL(char *) RTStrAllocTag(size_t cb, const char *pszTag)
+{
+    char *psz = (char *)RTMemAllocTag(RT_MAX(cb, 1), pszTag);
     if (psz)
         *psz = '\0';
     return psz;
 }
-RT_EXPORT_SYMBOL(RTStrAlloc);
-
-
-RTDECL(int) RTStrAllocEx(char **ppsz, size_t cb)
-{
-    char *psz = *ppsz = (char *)RTMemAlloc(RT_MAX(cb, 1));
+RT_EXPORT_SYMBOL(RTStrAllocTag);
+
+
+RTDECL(int) RTStrAllocExTag(char **ppsz, size_t cb, const char *pszTag)
+{
+    char *psz = *ppsz = (char *)RTMemAllocTag(RT_MAX(cb, 1), pszTag);
     if (psz)
     {
@@ -60,8 +60,8 @@
     return VERR_NO_STR_MEMORY;
 }
-RT_EXPORT_SYMBOL(RTStrAlloc);
-
-
-RTDECL(int) RTStrRealloc(char **ppsz, size_t cbNew)
+RT_EXPORT_SYMBOL(RTStrAllocTag);
+
+
+RTDECL(int) RTStrReallocTag(char **ppsz, size_t cbNew, const char *pszTag)
 {
     char *pszOld = *ppsz;
@@ -73,5 +73,5 @@
     else if (pszOld)
     {
-        char *pszNew = (char *)RTMemRealloc(pszOld, cbNew);
+        char *pszNew = (char *)RTMemReallocTag(pszOld, cbNew, pszTag);
         if (!pszNew)
             return VERR_NO_STR_MEMORY;
@@ -81,5 +81,5 @@
     else
     {
-        char *pszNew = (char *)RTMemAlloc(cbNew);
+        char *pszNew = (char *)RTMemAllocTag(cbNew, pszTag);
         if (!pszNew)
             return VERR_NO_STR_MEMORY;
@@ -90,4 +90,5 @@
     return VINF_SUCCESS;
 }
+RT_EXPORT_SYMBOL(RTStrReallocTag);
 
 RTDECL(void)  RTStrFree(char *pszString)
@@ -99,17 +100,17 @@
 
 
-RTDECL(char *) RTStrDup(const char *pszString)
+RTDECL(char *) RTStrDupTag(const char *pszString, const char *pszTag)
 {
     AssertPtr(pszString);
     size_t cch = strlen(pszString) + 1;
-    char *psz = (char *)RTMemAlloc(cch);
+    char *psz = (char *)RTMemAllocTag(cch, pszTag);
     if (psz)
         memcpy(psz, pszString, cch);
     return psz;
 }
-RT_EXPORT_SYMBOL(RTStrDup);
-
-
-RTDECL(int)  RTStrDupEx(char **ppszString, const char *pszString)
+RT_EXPORT_SYMBOL(RTStrDupTag);
+
+
+RTDECL(int)  RTStrDupExTag(char **ppszString, const char *pszString, const char *pszTag)
 {
     AssertPtr(ppszString);
@@ -117,5 +118,5 @@
 
     size_t cch = strlen(pszString) + 1;
-    char *psz = (char *)RTMemAlloc(cch);
+    char *psz = (char *)RTMemAllocTag(cch, pszTag);
     if (psz)
     {
@@ -126,13 +127,13 @@
     return VERR_NO_MEMORY;
 }
-RT_EXPORT_SYMBOL(RTStrDupEx);
-
-
-RTDECL(char *) RTStrDupN(const char *pszString, size_t cchMax)
+RT_EXPORT_SYMBOL(RTStrDupExTag);
+
+
+RTDECL(char *) RTStrDupNTag(const char *pszString, size_t cchMax, const char *pszTag)
 {
     AssertPtr(pszString);
     char const *pszEnd = RTStrEnd(pszString, cchMax);
     size_t      cch    = pszEnd ? (uintptr_t)pszEnd - (uintptr_t)pszString : cchMax;
-    char       *pszDst = (char *)RTMemAlloc(cch + 1);
+    char       *pszDst = (char *)RTMemAllocTag(cch + 1, pszTag);
     if (pszDst)
     {
@@ -142,16 +143,16 @@
     return pszDst;
 }
-RT_EXPORT_SYMBOL(RTStrDupN);
-
-
-RTDECL(int) RTStrAAppend(char **ppsz, const char *pszAppend)
+RT_EXPORT_SYMBOL(RTStrDupNTag);
+
+
+RTDECL(int) RTStrAAppendTag(char **ppsz, const char *pszAppend, const char *pszTag)
 {
     if (!pszAppend)
         return VINF_SUCCESS;
-    return RTStrAAppendN(ppsz, pszAppend, RTSTR_MAX);
-}
-
-
-RTDECL(int) RTStrAAppendN(char **ppsz, const char *pszAppend, size_t cchAppend)
+    return RTStrAAppendNTag(ppsz, pszAppend, RTSTR_MAX, pszTag);
+}
+
+
+RTDECL(int) RTStrAAppendNTag(char **ppsz, const char *pszAppend, size_t cchAppend, const char *pszTag)
 {
     if (!cchAppend)
@@ -163,5 +164,5 @@
 
     size_t const cchOrg = *ppsz ? strlen(*ppsz) : 0;
-    char *pszNew = (char *)RTMemRealloc(*ppsz, cchOrg + cchAppend + 1);
+    char *pszNew = (char *)RTMemReallocTag(*ppsz, cchOrg + cchAppend + 1, pszTag);
     if (!pszNew)
         return VERR_NO_STR_MEMORY;
@@ -175,5 +176,5 @@
 
 
-RTDECL(int) RTStrAAppendExNV(char **ppsz, size_t cPairs, va_list va)
+RTDECL(int) RTStrAAppendExNVTag(char **ppsz, size_t cPairs, va_list va, const char *pszTag)
 {
     AssertPtr(ppsz);
@@ -212,5 +213,5 @@
      * Try reallocate the string.
      */
-    char *pszNew = (char *)RTMemRealloc(*ppsz, cchNewTotal);
+    char *pszNew = (char *)RTMemReallocTag(*ppsz, cchNewTotal, pszTag);
     if (!pszNew)
         return VERR_NO_STR_MEMORY;
@@ -232,19 +233,8 @@
     return VINF_SUCCESS;
 }
-RT_EXPORT_SYMBOL(RTStrAAppendExNV);
-
-
-RTDECL(int) RTStrAAppendExN(char **ppsz, size_t cPairs, ...)
-{
-    va_list va;
-    va_start(va, cPairs);
-    int rc = RTStrAAppendExNV(ppsz, cPairs, va);
-    va_end(va);
-    return rc;
-}
-RT_EXPORT_SYMBOL(RTStrAAppendExN);
-
-
-RTDECL(int) RTStrATruncate(char **ppsz, size_t cchNew)
+RT_EXPORT_SYMBOL(RTStrAAppendExNVTag);
+
+
+RTDECL(int) RTStrATruncateTag(char **ppsz, size_t cchNew, const char *pszTag)
 {
     char *pszOld = *ppsz;
@@ -254,5 +244,5 @@
         {
             *pszOld = '\0';
-            char *pszNew = (char *)RTMemRealloc(pszOld, 1);
+            char *pszNew = (char *)RTMemReallocTag(pszOld, 1, pszTag);
             if (pszNew)
                 *ppsz = pszNew;
@@ -268,5 +258,5 @@
         if (!pszZero)
         {
-            char *pszNew = (char *)RTMemRealloc(pszOld,  cchNew + 1);
+            char *pszNew = (char *)RTMemReallocTag(pszOld,  cchNew + 1, pszTag);
             if (pszNew)
                 *ppsz = pszNew;
@@ -275,4 +265,4 @@
     return VINF_SUCCESS;
 }
-RT_EXPORT_SYMBOL(RTStrATruncate);
-
+RT_EXPORT_SYMBOL(RTStrATruncateTag);
+
Index: trunk/src/VBox/Runtime/common/string/utf-16.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/string/utf-16.cpp	(revision 30859)
+++ trunk/src/VBox/Runtime/common/string/utf-16.cpp	(revision 31157)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -48,21 +48,21 @@
 
 
-RTDECL(PRTUTF16) RTUtf16Dup(PCRTUTF16 pwszString)
+RTDECL(PRTUTF16) RTUtf16DupTag(PCRTUTF16 pwszString, const char *pszTag)
 {
     Assert(pwszString);
     size_t cb = (RTUtf16Len(pwszString) + 1) * sizeof(RTUTF16);
-    PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc(cb);
+    PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag(cb, pszTag);
     if (pwsz)
         memcpy(pwsz, pwszString, cb);
     return pwsz;
 }
-RT_EXPORT_SYMBOL(RTUtf16Dup);
-
-
-RTDECL(int) RTUtf16DupEx(PRTUTF16 *ppwszString, PCRTUTF16 pwszString, size_t cwcExtra)
+RT_EXPORT_SYMBOL(RTUtf16DupTag);
+
+
+RTDECL(int) RTUtf16DupExTag(PRTUTF16 *ppwszString, PCRTUTF16 pwszString, size_t cwcExtra, const char *pszTag)
 {
     Assert(pwszString);
     size_t cb = (RTUtf16Len(pwszString) + 1) * sizeof(RTUTF16);
-    PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc(cb + cwcExtra * sizeof(RTUTF16));
+    PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag(cb + cwcExtra * sizeof(RTUTF16), pszTag);
     if (pwsz)
     {
@@ -73,5 +73,5 @@
     return VERR_NO_MEMORY;
 }
-RT_EXPORT_SYMBOL(RTUtf16DupEx);
+RT_EXPORT_SYMBOL(RTUtf16DupExTag);
 
 
@@ -425,5 +425,5 @@
 
 
-RTDECL(int)  RTUtf16ToUtf8(PCRTUTF16 pwszString, char **ppszString)
+RTDECL(int)  RTUtf16ToUtf8Tag(PCRTUTF16 pwszString, char **ppszString, const char *pszTag)
 {
     /*
@@ -444,5 +444,5 @@
          * Allocate buffer and recode it.
          */
-        char *pszResult = (char *)RTMemAlloc(cch + 1);
+        char *pszResult = (char *)RTMemAllocTag(cch + 1, pszTag);
         if (pszResult)
         {
@@ -461,8 +461,8 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTUtf16ToUtf8);
-
-
-RTDECL(int)  RTUtf16ToUtf8Ex(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch)
+RT_EXPORT_SYMBOL(RTUtf16ToUtf8Tag);
+
+
+RTDECL(int)  RTUtf16ToUtf8ExTag(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch, const char *pszTag)
 {
     /*
@@ -500,5 +500,5 @@
             fShouldFree = true;
             cch = RT_MAX(cch, cchResult + 1);
-            pszResult = (char *)RTStrAlloc(cch);
+            pszResult = (char *)RTStrAllocTag(cch, pszTag);
         }
         if (pszResult)
@@ -519,5 +519,5 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTUtf16ToUtf8Ex);
+RT_EXPORT_SYMBOL(RTUtf16ToUtf8ExTag);
 
 
@@ -785,5 +785,5 @@
 
 
-RTDECL(int)  RTUtf16ToLatin1(PCRTUTF16 pwszString, char **ppszString)
+RTDECL(int)  RTUtf16ToLatin1Tag(PCRTUTF16 pwszString, char **ppszString, const char *pszTag)
 {
     /*
@@ -804,5 +804,5 @@
          * Allocate buffer and recode it.
          */
-        char *pszResult = (char *)RTMemAlloc(cch + 1);
+        char *pszResult = (char *)RTMemAllocTag(cch + 1, pszTag);
         if (pszResult)
         {
@@ -821,8 +821,8 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTUtf16ToLatin1);
-
-
-RTDECL(int)  RTUtf16ToLatin1Ex(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch)
+RT_EXPORT_SYMBOL(RTUtf16ToLatin1Tag);
+
+
+RTDECL(int)  RTUtf16ToLatin1ExTag(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch, const char *pszTag)
 {
     /*
@@ -860,5 +860,5 @@
             fShouldFree = true;
             cch = RT_MAX(cch, cchResult + 1);
-            pszResult = (char *)RTMemAlloc(cch);
+            pszResult = (char *)RTMemAllocTag(cch, pszTag);
         }
         if (pszResult)
@@ -879,5 +879,5 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTUtf16ToLatin1Ex);
+RT_EXPORT_SYMBOL(RTUtf16ToLatin1ExTag);
 
 
@@ -964,5 +964,5 @@
 
 
-RTDECL(int) RTLatin1ToUtf16(const char *pszString, PRTUTF16 *ppwszString)
+RTDECL(int) RTLatin1ToUtf16Tag(const char *pszString, PRTUTF16 *ppwszString, const char *pszTag)
 {
     /*
@@ -983,5 +983,5 @@
          * Allocate buffer.
          */
-        PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc((cwc + 1) * sizeof(RTUTF16));
+        PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag((cwc + 1) * sizeof(RTUTF16), pszTag);
         if (pwsz)
         {
@@ -1002,8 +1002,9 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTLatin1ToUtf16);
-
-
-RTDECL(int)  RTLatin1ToUtf16Ex(const char *pszString, size_t cchString, PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc)
+RT_EXPORT_SYMBOL(RTLatin1ToUtf16Tag);
+
+
+RTDECL(int)  RTLatin1ToUtf16ExTag(const char *pszString, size_t cchString,
+                                  PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc, const char *pszTag)
 {
     /*
@@ -1041,5 +1042,5 @@
             fShouldFree = true;
             cwc = RT_MAX(cwcResult + 1, cwc);
-            pwszResult = (PRTUTF16)RTMemAlloc(cwc * sizeof(RTUTF16));
+            pwszResult = (PRTUTF16)RTMemAllocTag(cwc * sizeof(RTUTF16), pszTag);
         }
         if (pwszResult)
@@ -1062,5 +1063,5 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTLatin1ToUtf16Ex);
+RT_EXPORT_SYMBOL(RTLatin1ToUtf16ExTag);
 
 
Index: trunk/src/VBox/Runtime/common/string/utf-8.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/string/utf-8.cpp	(revision 30859)
+++ trunk/src/VBox/Runtime/common/string/utf-8.cpp	(revision 31157)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2009 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -672,5 +672,5 @@
 
 
-RTDECL(int) RTStrToUtf16(const char *pszString, PRTUTF16 *ppwszString)
+RTDECL(int) RTStrToUtf16Tag(const char *pszString, PRTUTF16 *ppwszString, const char *pszTag)
 {
     /*
@@ -691,5 +691,5 @@
          * Allocate buffer.
          */
-        PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc((cwc + 1) * sizeof(RTUTF16));
+        PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag((cwc + 1) * sizeof(RTUTF16), pszTag);
         if (pwsz)
         {
@@ -710,8 +710,9 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTStrToUtf16);
-
-
-RTDECL(int)  RTStrToUtf16Ex(const char *pszString, size_t cchString, PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc)
+RT_EXPORT_SYMBOL(RTStrToUtf16Tag);
+
+
+RTDECL(int)  RTStrToUtf16ExTag(const char *pszString, size_t cchString,
+                               PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc, const char *pszTag)
 {
     /*
@@ -749,5 +750,5 @@
             fShouldFree = true;
             cwc = RT_MAX(cwcResult + 1, cwc);
-            pwszResult = (PRTUTF16)RTMemAlloc(cwc * sizeof(RTUTF16));
+            pwszResult = (PRTUTF16)RTMemAllocTag(cwc * sizeof(RTUTF16), pszTag);
         }
         if (pwszResult)
@@ -770,5 +771,5 @@
     return rc;
 }
-RT_EXPORT_SYMBOL(RTStrToUtf16Ex);
+RT_EXPORT_SYMBOL(RTStrToUtf16ExTag);
 
 
