VirtualBox

Changeset 31157 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Jul 28, 2010 3:15:35 AM (14 years ago)
Author:
vboxsync
Message:

iprt,++: Tag allocation in all builds with a string, defaulting to FILE.

Location:
trunk/src/VBox/Runtime/common
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/alloc/alloc.cpp

    r28800 r31157  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3636
    3737#undef RTMemDup
     38#undef RTMemDupTag
    3839#undef RTMemDupEx
     40#undef RTMemDupExTag
    3941
    4042
    4143
    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
     44RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW
    5145{
    52     void *pvDst = RTMemAlloc(cb);
     46    void *pvDst = RTMemAllocTag(cb, pszTag);
    5347    if (pvDst)
    5448        memcpy(pvDst, pvSrc, cb);
    5549    return pvDst;
    5650}
    57 RT_EXPORT_SYMBOL(RTMemDup);
     51RT_EXPORT_SYMBOL(RTMemDupTag);
    5852
    5953
    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
     54RTDECL(void *) RTMemDupExTag(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW
    7155{
    72     void *pvDst = RTMemAlloc(cbSrc + cbExtra);
     56    void *pvDst = RTMemAllocTag(cbSrc + cbExtra, pszTag);
    7357    if (pvDst)
    7458    {
     
    7862    return pvDst;
    7963}
    80 RT_EXPORT_SYMBOL(RTMemDupEx);
     64RT_EXPORT_SYMBOL(RTMemDupExTag);
    8165
  • trunk/src/VBox/Runtime/common/string/straprintf.cpp

    r28800 r31157  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4343{
    4444    /** Pointer to current buffer position. */
    45     char   *psz;
     45    char       *psz;
    4646    /** Number of bytes left in the buffer - not including the trailing zero. */
    47     size_t  cch;
     47    size_t      cch;
    4848    /** Pointer to the start of the buffer. */
    49     char   *pszBuffer;
     49    char       *pszBuffer;
    5050    /** The number of bytes in the buffer. */
    51     size_t  cchBuffer;
     51    size_t      cchBuffer;
    5252    /** Set if the buffer was allocated using RTMemRealloc(). If clear
    5353     * 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;
    5557} STRALLOCARG;
    5658/** Pointer to a strallocoutput() argument structure. */
     
    100102        if (cbAdded <= _1G)
    101103        {
    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);
    103106            if (pszBuffer)
    104107            {
     
    135138
    136139
    137 RTDECL(int) RTStrAPrintfV(char **ppszBuffer, const char *pszFormat, va_list args)
     140RTDECL(int) RTStrAPrintfVTag(char **ppszBuffer, const char *pszFormat, va_list args, const char *pszTag)
    138141{
    139142    char            szBuf[2048];
     
    144147    Arg.cch         = sizeof(szBuf) - 1;
    145148    Arg.psz         = szBuf;
     149    Arg.pszTag      = pszTag;
    146150    szBuf[0] = '\0';
    147151    int cbRet = (int)RTStrFormatV(strallocoutput, &Arg, NULL, NULL, pszFormat, args);
     
    152156            /* duplicate the string in szBuf */
    153157            Assert(Arg.pszBuffer == szBuf);
    154             char *psz = (char *)RTMemAlloc(cbRet + 1);
     158            char *psz = (char *)RTMemAllocTag(cbRet + 1, pszTag);
    155159            if (psz)
    156160                memcpy(psz, szBuf, cbRet + 1);
     
    160164        {
    161165            /* adjust the allocated buffer */
    162             char *psz = (char *)RTMemRealloc(Arg.pszBuffer, cbRet + 1);
     166            char *psz = (char *)RTMemReallocTag(Arg.pszBuffer, cbRet + 1, pszTag);
    163167            *ppszBuffer = psz ? psz : Arg.pszBuffer;
    164168        }
     
    177181    return cbRet;
    178182}
    179 RT_EXPORT_SYMBOL(RTStrAPrintfV);
     183RT_EXPORT_SYMBOL(RTStrAPrintfVTag);
    180184
    181185
    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)
     186RTDECL(char *) RTStrAPrintf2VTag(const char *pszFormat, va_list args, const char *pszTag)
    194187{
    195188    char *pszBuffer;
    196     RTStrAPrintfV(&pszBuffer, pszFormat, args);
     189    RTStrAPrintfVTag(&pszBuffer, pszFormat, args, pszTag);
    197190    return pszBuffer;
    198191}
    199 RT_EXPORT_SYMBOL(RTStrAPrintf2V);
     192RT_EXPORT_SYMBOL(RTStrAPrintf2VTag);
    200193
    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  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4040
    4141
    42 RTDECL(char *) RTStrAlloc(size_t cb)
    43 {
    44     char *psz = (char *)RTMemAlloc(RT_MAX(cb, 1));
     42RTDECL(char *) RTStrAllocTag(size_t cb, const char *pszTag)
     43{
     44    char *psz = (char *)RTMemAllocTag(RT_MAX(cb, 1), pszTag);
    4545    if (psz)
    4646        *psz = '\0';
    4747    return psz;
    4848}
    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));
     49RT_EXPORT_SYMBOL(RTStrAllocTag);
     50
     51
     52RTDECL(int) RTStrAllocExTag(char **ppsz, size_t cb, const char *pszTag)
     53{
     54    char *psz = *ppsz = (char *)RTMemAllocTag(RT_MAX(cb, 1), pszTag);
    5555    if (psz)
    5656    {
     
    6060    return VERR_NO_STR_MEMORY;
    6161}
    62 RT_EXPORT_SYMBOL(RTStrAlloc);
    63 
    64 
    65 RTDECL(int) RTStrRealloc(char **ppsz, size_t cbNew)
     62RT_EXPORT_SYMBOL(RTStrAllocTag);
     63
     64
     65RTDECL(int) RTStrReallocTag(char **ppsz, size_t cbNew, const char *pszTag)
    6666{
    6767    char *pszOld = *ppsz;
     
    7373    else if (pszOld)
    7474    {
    75         char *pszNew = (char *)RTMemRealloc(pszOld, cbNew);
     75        char *pszNew = (char *)RTMemReallocTag(pszOld, cbNew, pszTag);
    7676        if (!pszNew)
    7777            return VERR_NO_STR_MEMORY;
     
    8181    else
    8282    {
    83         char *pszNew = (char *)RTMemAlloc(cbNew);
     83        char *pszNew = (char *)RTMemAllocTag(cbNew, pszTag);
    8484        if (!pszNew)
    8585            return VERR_NO_STR_MEMORY;
     
    9090    return VINF_SUCCESS;
    9191}
     92RT_EXPORT_SYMBOL(RTStrReallocTag);
    9293
    9394RTDECL(void)  RTStrFree(char *pszString)
     
    99100
    100101
    101 RTDECL(char *) RTStrDup(const char *pszString)
     102RTDECL(char *) RTStrDupTag(const char *pszString, const char *pszTag)
    102103{
    103104    AssertPtr(pszString);
    104105    size_t cch = strlen(pszString) + 1;
    105     char *psz = (char *)RTMemAlloc(cch);
     106    char *psz = (char *)RTMemAllocTag(cch, pszTag);
    106107    if (psz)
    107108        memcpy(psz, pszString, cch);
    108109    return psz;
    109110}
    110 RT_EXPORT_SYMBOL(RTStrDup);
    111 
    112 
    113 RTDECL(int)  RTStrDupEx(char **ppszString, const char *pszString)
     111RT_EXPORT_SYMBOL(RTStrDupTag);
     112
     113
     114RTDECL(int)  RTStrDupExTag(char **ppszString, const char *pszString, const char *pszTag)
    114115{
    115116    AssertPtr(ppszString);
     
    117118
    118119    size_t cch = strlen(pszString) + 1;
    119     char *psz = (char *)RTMemAlloc(cch);
     120    char *psz = (char *)RTMemAllocTag(cch, pszTag);
    120121    if (psz)
    121122    {
     
    126127    return VERR_NO_MEMORY;
    127128}
    128 RT_EXPORT_SYMBOL(RTStrDupEx);
    129 
    130 
    131 RTDECL(char *) RTStrDupN(const char *pszString, size_t cchMax)
     129RT_EXPORT_SYMBOL(RTStrDupExTag);
     130
     131
     132RTDECL(char *) RTStrDupNTag(const char *pszString, size_t cchMax, const char *pszTag)
    132133{
    133134    AssertPtr(pszString);
    134135    char const *pszEnd = RTStrEnd(pszString, cchMax);
    135136    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);
    137138    if (pszDst)
    138139    {
     
    142143    return pszDst;
    143144}
    144 RT_EXPORT_SYMBOL(RTStrDupN);
    145 
    146 
    147 RTDECL(int) RTStrAAppend(char **ppsz, const char *pszAppend)
     145RT_EXPORT_SYMBOL(RTStrDupNTag);
     146
     147
     148RTDECL(int) RTStrAAppendTag(char **ppsz, const char *pszAppend, const char *pszTag)
    148149{
    149150    if (!pszAppend)
    150151        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
     156RTDECL(int) RTStrAAppendNTag(char **ppsz, const char *pszAppend, size_t cchAppend, const char *pszTag)
    156157{
    157158    if (!cchAppend)
     
    163164
    164165    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);
    166167    if (!pszNew)
    167168        return VERR_NO_STR_MEMORY;
     
    175176
    176177
    177 RTDECL(int) RTStrAAppendExNV(char **ppsz, size_t cPairs, va_list va)
     178RTDECL(int) RTStrAAppendExNVTag(char **ppsz, size_t cPairs, va_list va, const char *pszTag)
    178179{
    179180    AssertPtr(ppsz);
     
    212213     * Try reallocate the string.
    213214     */
    214     char *pszNew = (char *)RTMemRealloc(*ppsz, cchNewTotal);
     215    char *pszNew = (char *)RTMemReallocTag(*ppsz, cchNewTotal, pszTag);
    215216    if (!pszNew)
    216217        return VERR_NO_STR_MEMORY;
     
    232233    return VINF_SUCCESS;
    233234}
    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)
     235RT_EXPORT_SYMBOL(RTStrAAppendExNVTag);
     236
     237
     238RTDECL(int) RTStrATruncateTag(char **ppsz, size_t cchNew, const char *pszTag)
    249239{
    250240    char *pszOld = *ppsz;
     
    254244        {
    255245            *pszOld = '\0';
    256             char *pszNew = (char *)RTMemRealloc(pszOld, 1);
     246            char *pszNew = (char *)RTMemReallocTag(pszOld, 1, pszTag);
    257247            if (pszNew)
    258248                *ppsz = pszNew;
     
    268258        if (!pszZero)
    269259        {
    270             char *pszNew = (char *)RTMemRealloc(pszOld,  cchNew + 1);
     260            char *pszNew = (char *)RTMemReallocTag(pszOld,  cchNew + 1, pszTag);
    271261            if (pszNew)
    272262                *ppsz = pszNew;
     
    275265    return VINF_SUCCESS;
    276266}
    277 RT_EXPORT_SYMBOL(RTStrATruncate);
    278 
     267RT_EXPORT_SYMBOL(RTStrATruncateTag);
     268
  • trunk/src/VBox/Runtime/common/string/utf-16.cpp

    r30749 r31157  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4848
    4949
    50 RTDECL(PRTUTF16) RTUtf16Dup(PCRTUTF16 pwszString)
     50RTDECL(PRTUTF16) RTUtf16DupTag(PCRTUTF16 pwszString, const char *pszTag)
    5151{
    5252    Assert(pwszString);
    5353    size_t cb = (RTUtf16Len(pwszString) + 1) * sizeof(RTUTF16);
    54     PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc(cb);
     54    PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag(cb, pszTag);
    5555    if (pwsz)
    5656        memcpy(pwsz, pwszString, cb);
    5757    return pwsz;
    5858}
    59 RT_EXPORT_SYMBOL(RTUtf16Dup);
    60 
    61 
    62 RTDECL(int) RTUtf16DupEx(PRTUTF16 *ppwszString, PCRTUTF16 pwszString, size_t cwcExtra)
     59RT_EXPORT_SYMBOL(RTUtf16DupTag);
     60
     61
     62RTDECL(int) RTUtf16DupExTag(PRTUTF16 *ppwszString, PCRTUTF16 pwszString, size_t cwcExtra, const char *pszTag)
    6363{
    6464    Assert(pwszString);
    6565    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);
    6767    if (pwsz)
    6868    {
     
    7373    return VERR_NO_MEMORY;
    7474}
    75 RT_EXPORT_SYMBOL(RTUtf16DupEx);
     75RT_EXPORT_SYMBOL(RTUtf16DupExTag);
    7676
    7777
     
    425425
    426426
    427 RTDECL(int)  RTUtf16ToUtf8(PCRTUTF16 pwszString, char **ppszString)
     427RTDECL(int)  RTUtf16ToUtf8Tag(PCRTUTF16 pwszString, char **ppszString, const char *pszTag)
    428428{
    429429    /*
     
    444444         * Allocate buffer and recode it.
    445445         */
    446         char *pszResult = (char *)RTMemAlloc(cch + 1);
     446        char *pszResult = (char *)RTMemAllocTag(cch + 1, pszTag);
    447447        if (pszResult)
    448448        {
     
    461461    return rc;
    462462}
    463 RT_EXPORT_SYMBOL(RTUtf16ToUtf8);
    464 
    465 
    466 RTDECL(int)  RTUtf16ToUtf8Ex(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch)
     463RT_EXPORT_SYMBOL(RTUtf16ToUtf8Tag);
     464
     465
     466RTDECL(int)  RTUtf16ToUtf8ExTag(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch, const char *pszTag)
    467467{
    468468    /*
     
    500500            fShouldFree = true;
    501501            cch = RT_MAX(cch, cchResult + 1);
    502             pszResult = (char *)RTStrAlloc(cch);
     502            pszResult = (char *)RTStrAllocTag(cch, pszTag);
    503503        }
    504504        if (pszResult)
     
    519519    return rc;
    520520}
    521 RT_EXPORT_SYMBOL(RTUtf16ToUtf8Ex);
     521RT_EXPORT_SYMBOL(RTUtf16ToUtf8ExTag);
    522522
    523523
     
    785785
    786786
    787 RTDECL(int)  RTUtf16ToLatin1(PCRTUTF16 pwszString, char **ppszString)
     787RTDECL(int)  RTUtf16ToLatin1Tag(PCRTUTF16 pwszString, char **ppszString, const char *pszTag)
    788788{
    789789    /*
     
    804804         * Allocate buffer and recode it.
    805805         */
    806         char *pszResult = (char *)RTMemAlloc(cch + 1);
     806        char *pszResult = (char *)RTMemAllocTag(cch + 1, pszTag);
    807807        if (pszResult)
    808808        {
     
    821821    return rc;
    822822}
    823 RT_EXPORT_SYMBOL(RTUtf16ToLatin1);
    824 
    825 
    826 RTDECL(int)  RTUtf16ToLatin1Ex(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch)
     823RT_EXPORT_SYMBOL(RTUtf16ToLatin1Tag);
     824
     825
     826RTDECL(int)  RTUtf16ToLatin1ExTag(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch, const char *pszTag)
    827827{
    828828    /*
     
    860860            fShouldFree = true;
    861861            cch = RT_MAX(cch, cchResult + 1);
    862             pszResult = (char *)RTMemAlloc(cch);
     862            pszResult = (char *)RTMemAllocTag(cch, pszTag);
    863863        }
    864864        if (pszResult)
     
    879879    return rc;
    880880}
    881 RT_EXPORT_SYMBOL(RTUtf16ToLatin1Ex);
     881RT_EXPORT_SYMBOL(RTUtf16ToLatin1ExTag);
    882882
    883883
     
    964964
    965965
    966 RTDECL(int) RTLatin1ToUtf16(const char *pszString, PRTUTF16 *ppwszString)
     966RTDECL(int) RTLatin1ToUtf16Tag(const char *pszString, PRTUTF16 *ppwszString, const char *pszTag)
    967967{
    968968    /*
     
    983983         * Allocate buffer.
    984984         */
    985         PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc((cwc + 1) * sizeof(RTUTF16));
     985        PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag((cwc + 1) * sizeof(RTUTF16), pszTag);
    986986        if (pwsz)
    987987        {
     
    10021002    return rc;
    10031003}
    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)
     1004RT_EXPORT_SYMBOL(RTLatin1ToUtf16Tag);
     1005
     1006
     1007RTDECL(int)  RTLatin1ToUtf16ExTag(const char *pszString, size_t cchString,
     1008                                  PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc, const char *pszTag)
    10081009{
    10091010    /*
     
    10411042            fShouldFree = true;
    10421043            cwc = RT_MAX(cwcResult + 1, cwc);
    1043             pwszResult = (PRTUTF16)RTMemAlloc(cwc * sizeof(RTUTF16));
     1044            pwszResult = (PRTUTF16)RTMemAllocTag(cwc * sizeof(RTUTF16), pszTag);
    10441045        }
    10451046        if (pwszResult)
     
    10621063    return rc;
    10631064}
    1064 RT_EXPORT_SYMBOL(RTLatin1ToUtf16Ex);
     1065RT_EXPORT_SYMBOL(RTLatin1ToUtf16ExTag);
    10651066
    10661067
  • trunk/src/VBox/Runtime/common/string/utf-8.cpp

    r30859 r31157  
    55
    66/*
    7  * Copyright (C) 2006-2009 Oracle Corporation
     7 * Copyright (C) 2006-2010 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    672672
    673673
    674 RTDECL(int) RTStrToUtf16(const char *pszString, PRTUTF16 *ppwszString)
     674RTDECL(int) RTStrToUtf16Tag(const char *pszString, PRTUTF16 *ppwszString, const char *pszTag)
    675675{
    676676    /*
     
    691691         * Allocate buffer.
    692692         */
    693         PRTUTF16 pwsz = (PRTUTF16)RTMemAlloc((cwc + 1) * sizeof(RTUTF16));
     693        PRTUTF16 pwsz = (PRTUTF16)RTMemAllocTag((cwc + 1) * sizeof(RTUTF16), pszTag);
    694694        if (pwsz)
    695695        {
     
    710710    return rc;
    711711}
    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)
     712RT_EXPORT_SYMBOL(RTStrToUtf16Tag);
     713
     714
     715RTDECL(int)  RTStrToUtf16ExTag(const char *pszString, size_t cchString,
     716                               PRTUTF16 *ppwsz, size_t cwc, size_t *pcwc, const char *pszTag)
    716717{
    717718    /*
     
    749750            fShouldFree = true;
    750751            cwc = RT_MAX(cwcResult + 1, cwc);
    751             pwszResult = (PRTUTF16)RTMemAlloc(cwc * sizeof(RTUTF16));
     752            pwszResult = (PRTUTF16)RTMemAllocTag(cwc * sizeof(RTUTF16), pszTag);
    752753        }
    753754        if (pwszResult)
     
    770771    return rc;
    771772}
    772 RT_EXPORT_SYMBOL(RTStrToUtf16Ex);
     773RT_EXPORT_SYMBOL(RTStrToUtf16ExTag);
    773774
    774775
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette