Changeset 31157 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Jul 28, 2010 3:15:35 AM (14 years ago)
- Location:
- trunk/src/VBox/Runtime/common
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/alloc/alloc.cpp
r28800 r31157 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 36 36 37 37 #undef RTMemDup 38 #undef RTMemDupTag 38 39 #undef RTMemDupEx 40 #undef RTMemDupExTag 39 41 40 42 41 43 42 /** 43 * Duplicates a chunk of memory into a new heap block. 44 * 45 * @returns New heap block with the duplicate data. 46 * @returns NULL if we're out of memory. 47 * @param pvSrc The memory to duplicate. 48 * @param cb The amount of memory to duplicate. 49 */ 50 RTDECL(void *) RTMemDup(const void *pvSrc, size_t cb) RT_NO_THROW 44 RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW 51 45 { 52 void *pvDst = RTMemAlloc (cb);46 void *pvDst = RTMemAllocTag(cb, pszTag); 53 47 if (pvDst) 54 48 memcpy(pvDst, pvSrc, cb); 55 49 return pvDst; 56 50 } 57 RT_EXPORT_SYMBOL(RTMemDup );51 RT_EXPORT_SYMBOL(RTMemDupTag); 58 52 59 53 60 /** 61 * Duplicates a chunk of memory into a new heap block with some 62 * additional zeroed memory. 63 * 64 * @returns New heap block with the duplicate data. 65 * @returns NULL if we're out of memory. 66 * @param pvSrc The memory to duplicate. 67 * @param cbSrc The amount of memory to duplicate. 68 * @param cbExtra The amount of extra memory to allocate and zero. 69 */ 70 RTDECL(void *) RTMemDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra) RT_NO_THROW 54 RTDECL(void *) RTMemDupExTag(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW 71 55 { 72 void *pvDst = RTMemAlloc (cbSrc + cbExtra);56 void *pvDst = RTMemAllocTag(cbSrc + cbExtra, pszTag); 73 57 if (pvDst) 74 58 { … … 78 62 return pvDst; 79 63 } 80 RT_EXPORT_SYMBOL(RTMemDupEx );64 RT_EXPORT_SYMBOL(RTMemDupExTag); 81 65 -
trunk/src/VBox/Runtime/common/string/straprintf.cpp
r28800 r31157 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 43 43 { 44 44 /** Pointer to current buffer position. */ 45 char *psz;45 char *psz; 46 46 /** Number of bytes left in the buffer - not including the trailing zero. */ 47 size_t cch;47 size_t cch; 48 48 /** Pointer to the start of the buffer. */ 49 char *pszBuffer;49 char *pszBuffer; 50 50 /** The number of bytes in the buffer. */ 51 size_t cchBuffer;51 size_t cchBuffer; 52 52 /** Set if the buffer was allocated using RTMemRealloc(). If clear 53 53 * pszBuffer points to the initial stack buffer. */ 54 bool fAllocated; 54 bool fAllocated; 55 /** Allocation tag used for statistics and such. */ 56 const char *pszTag; 55 57 } STRALLOCARG; 56 58 /** Pointer to a strallocoutput() argument structure. */ … … 100 102 if (cbAdded <= _1G) 101 103 { 102 char *pszBuffer = (char *)RTMemRealloc(pArg->fAllocated ? pArg->pszBuffer : NULL, cbAdded + pArg->cchBuffer); 104 char *pszBuffer = (char *)RTMemReallocTag(pArg->fAllocated ? pArg->pszBuffer : NULL, 105 cbAdded + pArg->cchBuffer, pArg->pszTag); 103 106 if (pszBuffer) 104 107 { … … 135 138 136 139 137 RTDECL(int) RTStrAPrintfV (char **ppszBuffer, const char *pszFormat, va_list args)140 RTDECL(int) RTStrAPrintfVTag(char **ppszBuffer, const char *pszFormat, va_list args, const char *pszTag) 138 141 { 139 142 char szBuf[2048]; … … 144 147 Arg.cch = sizeof(szBuf) - 1; 145 148 Arg.psz = szBuf; 149 Arg.pszTag = pszTag; 146 150 szBuf[0] = '\0'; 147 151 int cbRet = (int)RTStrFormatV(strallocoutput, &Arg, NULL, NULL, pszFormat, args); … … 152 156 /* duplicate the string in szBuf */ 153 157 Assert(Arg.pszBuffer == szBuf); 154 char *psz = (char *)RTMemAlloc (cbRet + 1);158 char *psz = (char *)RTMemAllocTag(cbRet + 1, pszTag); 155 159 if (psz) 156 160 memcpy(psz, szBuf, cbRet + 1); … … 160 164 { 161 165 /* adjust the allocated buffer */ 162 char *psz = (char *)RTMemRealloc (Arg.pszBuffer, cbRet + 1);166 char *psz = (char *)RTMemReallocTag(Arg.pszBuffer, cbRet + 1, pszTag); 163 167 *ppszBuffer = psz ? psz : Arg.pszBuffer; 164 168 } … … 177 181 return cbRet; 178 182 } 179 RT_EXPORT_SYMBOL(RTStrAPrintfV );183 RT_EXPORT_SYMBOL(RTStrAPrintfVTag); 180 184 181 185 182 RTDECL(int) RTStrAPrintf(char **ppszBuffer, const char *pszFormat, ...) 183 { 184 va_list args; 185 va_start(args, pszFormat); 186 int cbRet = RTStrAPrintfV(ppszBuffer, pszFormat, args); 187 va_end(args); 188 return cbRet; 189 } 190 RT_EXPORT_SYMBOL(RTStrAPrintf); 191 192 193 RTDECL(char *) RTStrAPrintf2V(const char *pszFormat, va_list args) 186 RTDECL(char *) RTStrAPrintf2VTag(const char *pszFormat, va_list args, const char *pszTag) 194 187 { 195 188 char *pszBuffer; 196 RTStrAPrintfV (&pszBuffer, pszFormat, args);189 RTStrAPrintfVTag(&pszBuffer, pszFormat, args, pszTag); 197 190 return pszBuffer; 198 191 } 199 RT_EXPORT_SYMBOL(RTStrAPrintf2V );192 RT_EXPORT_SYMBOL(RTStrAPrintf2VTag); 200 193 201 202 RTDECL(char *) RTStrAPrintf2(const char *pszFormat, ...)203 {204 va_list va;205 char *pszBuffer;206 207 va_start(va, pszFormat);208 RTStrAPrintfV(&pszBuffer, pszFormat, va);209 va_end(va);210 211 return pszBuffer;212 }213 RT_EXPORT_SYMBOL(RTStrAPrintf2);214 -
trunk/src/VBox/Runtime/common/string/stringalloc.cpp
r30320 r31157 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 40 40 41 41 42 RTDECL(char *) RTStrAlloc (size_t cb)43 { 44 char *psz = (char *)RTMemAlloc (RT_MAX(cb, 1));42 RTDECL(char *) RTStrAllocTag(size_t cb, const char *pszTag) 43 { 44 char *psz = (char *)RTMemAllocTag(RT_MAX(cb, 1), pszTag); 45 45 if (psz) 46 46 *psz = '\0'; 47 47 return psz; 48 48 } 49 RT_EXPORT_SYMBOL(RTStrAlloc );50 51 52 RTDECL(int) RTStrAllocEx (char **ppsz, size_t cb)53 { 54 char *psz = *ppsz = (char *)RTMemAlloc (RT_MAX(cb, 1));49 RT_EXPORT_SYMBOL(RTStrAllocTag); 50 51 52 RTDECL(int) RTStrAllocExTag(char **ppsz, size_t cb, const char *pszTag) 53 { 54 char *psz = *ppsz = (char *)RTMemAllocTag(RT_MAX(cb, 1), pszTag); 55 55 if (psz) 56 56 { … … 60 60 return VERR_NO_STR_MEMORY; 61 61 } 62 RT_EXPORT_SYMBOL(RTStrAlloc );63 64 65 RTDECL(int) RTStrRealloc (char **ppsz, size_t cbNew)62 RT_EXPORT_SYMBOL(RTStrAllocTag); 63 64 65 RTDECL(int) RTStrReallocTag(char **ppsz, size_t cbNew, const char *pszTag) 66 66 { 67 67 char *pszOld = *ppsz; … … 73 73 else if (pszOld) 74 74 { 75 char *pszNew = (char *)RTMemRealloc (pszOld, cbNew);75 char *pszNew = (char *)RTMemReallocTag(pszOld, cbNew, pszTag); 76 76 if (!pszNew) 77 77 return VERR_NO_STR_MEMORY; … … 81 81 else 82 82 { 83 char *pszNew = (char *)RTMemAlloc (cbNew);83 char *pszNew = (char *)RTMemAllocTag(cbNew, pszTag); 84 84 if (!pszNew) 85 85 return VERR_NO_STR_MEMORY; … … 90 90 return VINF_SUCCESS; 91 91 } 92 RT_EXPORT_SYMBOL(RTStrReallocTag); 92 93 93 94 RTDECL(void) RTStrFree(char *pszString) … … 99 100 100 101 101 RTDECL(char *) RTStrDup (const char *pszString)102 RTDECL(char *) RTStrDupTag(const char *pszString, const char *pszTag) 102 103 { 103 104 AssertPtr(pszString); 104 105 size_t cch = strlen(pszString) + 1; 105 char *psz = (char *)RTMemAlloc (cch);106 char *psz = (char *)RTMemAllocTag(cch, pszTag); 106 107 if (psz) 107 108 memcpy(psz, pszString, cch); 108 109 return psz; 109 110 } 110 RT_EXPORT_SYMBOL(RTStrDup );111 112 113 RTDECL(int) RTStrDupEx (char **ppszString, const char *pszString)111 RT_EXPORT_SYMBOL(RTStrDupTag); 112 113 114 RTDECL(int) RTStrDupExTag(char **ppszString, const char *pszString, const char *pszTag) 114 115 { 115 116 AssertPtr(ppszString); … … 117 118 118 119 size_t cch = strlen(pszString) + 1; 119 char *psz = (char *)RTMemAlloc (cch);120 char *psz = (char *)RTMemAllocTag(cch, pszTag); 120 121 if (psz) 121 122 { … … 126 127 return VERR_NO_MEMORY; 127 128 } 128 RT_EXPORT_SYMBOL(RTStrDupEx );129 130 131 RTDECL(char *) RTStrDupN (const char *pszString, size_t cchMax)129 RT_EXPORT_SYMBOL(RTStrDupExTag); 130 131 132 RTDECL(char *) RTStrDupNTag(const char *pszString, size_t cchMax, const char *pszTag) 132 133 { 133 134 AssertPtr(pszString); 134 135 char const *pszEnd = RTStrEnd(pszString, cchMax); 135 136 size_t cch = pszEnd ? (uintptr_t)pszEnd - (uintptr_t)pszString : cchMax; 136 char *pszDst = (char *)RTMemAlloc (cch + 1);137 char *pszDst = (char *)RTMemAllocTag(cch + 1, pszTag); 137 138 if (pszDst) 138 139 { … … 142 143 return pszDst; 143 144 } 144 RT_EXPORT_SYMBOL(RTStrDupN );145 146 147 RTDECL(int) RTStrAAppend (char **ppsz, const char *pszAppend)145 RT_EXPORT_SYMBOL(RTStrDupNTag); 146 147 148 RTDECL(int) RTStrAAppendTag(char **ppsz, const char *pszAppend, const char *pszTag) 148 149 { 149 150 if (!pszAppend) 150 151 return VINF_SUCCESS; 151 return RTStrAAppendN (ppsz, pszAppend, RTSTR_MAX);152 } 153 154 155 RTDECL(int) RTStrAAppendN (char **ppsz, const char *pszAppend, size_t cchAppend)152 return RTStrAAppendNTag(ppsz, pszAppend, RTSTR_MAX, pszTag); 153 } 154 155 156 RTDECL(int) RTStrAAppendNTag(char **ppsz, const char *pszAppend, size_t cchAppend, const char *pszTag) 156 157 { 157 158 if (!cchAppend) … … 163 164 164 165 size_t const cchOrg = *ppsz ? strlen(*ppsz) : 0; 165 char *pszNew = (char *)RTMemRealloc (*ppsz, cchOrg + cchAppend + 1);166 char *pszNew = (char *)RTMemReallocTag(*ppsz, cchOrg + cchAppend + 1, pszTag); 166 167 if (!pszNew) 167 168 return VERR_NO_STR_MEMORY; … … 175 176 176 177 177 RTDECL(int) RTStrAAppendExNV (char **ppsz, size_t cPairs, va_list va)178 RTDECL(int) RTStrAAppendExNVTag(char **ppsz, size_t cPairs, va_list va, const char *pszTag) 178 179 { 179 180 AssertPtr(ppsz); … … 212 213 * Try reallocate the string. 213 214 */ 214 char *pszNew = (char *)RTMemRealloc (*ppsz, cchNewTotal);215 char *pszNew = (char *)RTMemReallocTag(*ppsz, cchNewTotal, pszTag); 215 216 if (!pszNew) 216 217 return VERR_NO_STR_MEMORY; … … 232 233 return VINF_SUCCESS; 233 234 } 234 RT_EXPORT_SYMBOL(RTStrAAppendExNV); 235 236 237 RTDECL(int) RTStrAAppendExN(char **ppsz, size_t cPairs, ...) 238 { 239 va_list va; 240 va_start(va, cPairs); 241 int rc = RTStrAAppendExNV(ppsz, cPairs, va); 242 va_end(va); 243 return rc; 244 } 245 RT_EXPORT_SYMBOL(RTStrAAppendExN); 246 247 248 RTDECL(int) RTStrATruncate(char **ppsz, size_t cchNew) 235 RT_EXPORT_SYMBOL(RTStrAAppendExNVTag); 236 237 238 RTDECL(int) RTStrATruncateTag(char **ppsz, size_t cchNew, const char *pszTag) 249 239 { 250 240 char *pszOld = *ppsz; … … 254 244 { 255 245 *pszOld = '\0'; 256 char *pszNew = (char *)RTMemRealloc (pszOld, 1);246 char *pszNew = (char *)RTMemReallocTag(pszOld, 1, pszTag); 257 247 if (pszNew) 258 248 *ppsz = pszNew; … … 268 258 if (!pszZero) 269 259 { 270 char *pszNew = (char *)RTMemRealloc (pszOld, cchNew + 1);260 char *pszNew = (char *)RTMemReallocTag(pszOld, cchNew + 1, pszTag); 271 261 if (pszNew) 272 262 *ppsz = pszNew; … … 275 265 return VINF_SUCCESS; 276 266 } 277 RT_EXPORT_SYMBOL(RTStrATruncate );278 267 RT_EXPORT_SYMBOL(RTStrATruncateTag); 268 -
trunk/src/VBox/Runtime/common/string/utf-16.cpp
r30749 r31157 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 48 48 49 49 50 RTDECL(PRTUTF16) RTUtf16Dup (PCRTUTF16 pwszString)50 RTDECL(PRTUTF16) RTUtf16DupTag(PCRTUTF16 pwszString, const char *pszTag) 51 51 { 52 52 Assert(pwszString); 53 53 size_t cb = (RTUtf16Len(pwszString) + 1) * sizeof(RTUTF16); 54 PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc (cb);54 PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag(cb, pszTag); 55 55 if (pwsz) 56 56 memcpy(pwsz, pwszString, cb); 57 57 return pwsz; 58 58 } 59 RT_EXPORT_SYMBOL(RTUtf16Dup );60 61 62 RTDECL(int) RTUtf16DupEx (PRTUTF16 *ppwszString, PCRTUTF16 pwszString, size_t cwcExtra)59 RT_EXPORT_SYMBOL(RTUtf16DupTag); 60 61 62 RTDECL(int) RTUtf16DupExTag(PRTUTF16 *ppwszString, PCRTUTF16 pwszString, size_t cwcExtra, const char *pszTag) 63 63 { 64 64 Assert(pwszString); 65 65 size_t cb = (RTUtf16Len(pwszString) + 1) * sizeof(RTUTF16); 66 PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc (cb + cwcExtra * sizeof(RTUTF16));66 PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag(cb + cwcExtra * sizeof(RTUTF16), pszTag); 67 67 if (pwsz) 68 68 { … … 73 73 return VERR_NO_MEMORY; 74 74 } 75 RT_EXPORT_SYMBOL(RTUtf16DupEx );75 RT_EXPORT_SYMBOL(RTUtf16DupExTag); 76 76 77 77 … … 425 425 426 426 427 RTDECL(int) RTUtf16ToUtf8 (PCRTUTF16 pwszString, char **ppszString)427 RTDECL(int) RTUtf16ToUtf8Tag(PCRTUTF16 pwszString, char **ppszString, const char *pszTag) 428 428 { 429 429 /* … … 444 444 * Allocate buffer and recode it. 445 445 */ 446 char *pszResult = (char *)RTMemAlloc (cch + 1);446 char *pszResult = (char *)RTMemAllocTag(cch + 1, pszTag); 447 447 if (pszResult) 448 448 { … … 461 461 return rc; 462 462 } 463 RT_EXPORT_SYMBOL(RTUtf16ToUtf8 );464 465 466 RTDECL(int) RTUtf16ToUtf8Ex (PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch)463 RT_EXPORT_SYMBOL(RTUtf16ToUtf8Tag); 464 465 466 RTDECL(int) RTUtf16ToUtf8ExTag(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch, const char *pszTag) 467 467 { 468 468 /* … … 500 500 fShouldFree = true; 501 501 cch = RT_MAX(cch, cchResult + 1); 502 pszResult = (char *)RTStrAlloc (cch);502 pszResult = (char *)RTStrAllocTag(cch, pszTag); 503 503 } 504 504 if (pszResult) … … 519 519 return rc; 520 520 } 521 RT_EXPORT_SYMBOL(RTUtf16ToUtf8Ex );521 RT_EXPORT_SYMBOL(RTUtf16ToUtf8ExTag); 522 522 523 523 … … 785 785 786 786 787 RTDECL(int) RTUtf16ToLatin1 (PCRTUTF16 pwszString, char **ppszString)787 RTDECL(int) RTUtf16ToLatin1Tag(PCRTUTF16 pwszString, char **ppszString, const char *pszTag) 788 788 { 789 789 /* … … 804 804 * Allocate buffer and recode it. 805 805 */ 806 char *pszResult = (char *)RTMemAlloc (cch + 1);806 char *pszResult = (char *)RTMemAllocTag(cch + 1, pszTag); 807 807 if (pszResult) 808 808 { … … 821 821 return rc; 822 822 } 823 RT_EXPORT_SYMBOL(RTUtf16ToLatin1 );824 825 826 RTDECL(int) RTUtf16ToLatin1Ex (PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch)823 RT_EXPORT_SYMBOL(RTUtf16ToLatin1Tag); 824 825 826 RTDECL(int) RTUtf16ToLatin1ExTag(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch, const char *pszTag) 827 827 { 828 828 /* … … 860 860 fShouldFree = true; 861 861 cch = RT_MAX(cch, cchResult + 1); 862 pszResult = (char *)RTMemAlloc (cch);862 pszResult = (char *)RTMemAllocTag(cch, pszTag); 863 863 } 864 864 if (pszResult) … … 879 879 return rc; 880 880 } 881 RT_EXPORT_SYMBOL(RTUtf16ToLatin1Ex );881 RT_EXPORT_SYMBOL(RTUtf16ToLatin1ExTag); 882 882 883 883 … … 964 964 965 965 966 RTDECL(int) RTLatin1ToUtf16 (const char *pszString, PRTUTF16 *ppwszString)966 RTDECL(int) RTLatin1ToUtf16Tag(const char *pszString, PRTUTF16 *ppwszString, const char *pszTag) 967 967 { 968 968 /* … … 983 983 * Allocate buffer. 984 984 */ 985 PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc ((cwc + 1) * sizeof(RTUTF16));985 PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag((cwc + 1) * sizeof(RTUTF16), pszTag); 986 986 if (pwsz) 987 987 { … … 1002 1002 return rc; 1003 1003 } 1004 RT_EXPORT_SYMBOL(RTLatin1ToUtf16); 1005 1006 1007 RTDECL(int) RTLatin1ToUtf16Ex(const char *pszString, size_t cchString, PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc) 1004 RT_EXPORT_SYMBOL(RTLatin1ToUtf16Tag); 1005 1006 1007 RTDECL(int) RTLatin1ToUtf16ExTag(const char *pszString, size_t cchString, 1008 PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc, const char *pszTag) 1008 1009 { 1009 1010 /* … … 1041 1042 fShouldFree = true; 1042 1043 cwc = RT_MAX(cwcResult + 1, cwc); 1043 pwszResult = (PRTUTF16)RTMemAlloc (cwc * sizeof(RTUTF16));1044 pwszResult = (PRTUTF16)RTMemAllocTag(cwc * sizeof(RTUTF16), pszTag); 1044 1045 } 1045 1046 if (pwszResult) … … 1062 1063 return rc; 1063 1064 } 1064 RT_EXPORT_SYMBOL(RTLatin1ToUtf16Ex );1065 RT_EXPORT_SYMBOL(RTLatin1ToUtf16ExTag); 1065 1066 1066 1067 -
trunk/src/VBox/Runtime/common/string/utf-8.cpp
r30859 r31157 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 672 672 673 673 674 RTDECL(int) RTStrToUtf16 (const char *pszString, PRTUTF16 *ppwszString)674 RTDECL(int) RTStrToUtf16Tag(const char *pszString, PRTUTF16 *ppwszString, const char *pszTag) 675 675 { 676 676 /* … … 691 691 * Allocate buffer. 692 692 */ 693 PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc ((cwc + 1) * sizeof(RTUTF16));693 PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag((cwc + 1) * sizeof(RTUTF16), pszTag); 694 694 if (pwsz) 695 695 { … … 710 710 return rc; 711 711 } 712 RT_EXPORT_SYMBOL(RTStrToUtf16); 713 714 715 RTDECL(int) RTStrToUtf16Ex(const char *pszString, size_t cchString, PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc) 712 RT_EXPORT_SYMBOL(RTStrToUtf16Tag); 713 714 715 RTDECL(int) RTStrToUtf16ExTag(const char *pszString, size_t cchString, 716 PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc, const char *pszTag) 716 717 { 717 718 /* … … 749 750 fShouldFree = true; 750 751 cwc = RT_MAX(cwcResult + 1, cwc); 751 pwszResult = (PRTUTF16)RTMemAlloc (cwc * sizeof(RTUTF16));752 pwszResult = (PRTUTF16)RTMemAllocTag(cwc * sizeof(RTUTF16), pszTag); 752 753 } 753 754 if (pwszResult) … … 770 771 return rc; 771 772 } 772 RT_EXPORT_SYMBOL(RTStrToUtf16Ex );773 RT_EXPORT_SYMBOL(RTStrToUtf16ExTag); 773 774 774 775
Note:
See TracChangeset
for help on using the changeset viewer.