Changeset 72613 in vbox
- Timestamp:
- Jun 19, 2018 1:16:32 PM (6 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp
r72602 r72613 1046 1046 size_t const cbFile = pSrcPos->pszFile ? strlen(pSrcPos->pszFile) + 1 : 0; 1047 1047 size_t const cbFunction = pSrcPos->pszFile ? strlen(pSrcPos->pszFunction) + 1 : 0; 1048 RTLOCKVALCLASSINT *pThis = (RTLOCKVALCLASSINT *)RTMemAllocVar(sizeof(*pThis) + cbFile + cbFunction + cbName); 1048 RTLOCKVALCLASSINT *pThis = (RTLOCKVALCLASSINT *)RTMemAllocVarTag(sizeof(*pThis) + cbFile + cbFunction + cbName, 1049 "may-leak:RTLockValidatorClassCreateExV"); 1049 1050 if (!pThis) 1050 1051 return VERR_NO_MEMORY; … … 1097 1098 #endif 1098 1099 1099 #ifdef VBOX_WITH_GCC_SANITIZER1100 __lsan_ignore_object(pThis);1101 #endif1102 1100 *phClass = pThis; 1103 1101 return VINF_SUCCESS; -
trunk/src/VBox/Runtime/r3/alloc.cpp
r69973 r72613 86 86 87 87 88 #ifdef VBOX_WITH_GCC_SANITIZER 89 /** 90 * Checks if @a pszTag is a leak tag. 91 * 92 * @returns true if leak tag, false if not. 93 * @param pszTag Tage to inspect. 94 */ 95 DECLINLINE(bool) rtMemIsLeakTag(const char *pszTag) 96 { 97 char ch = *pszTag; 98 if (ch != 'w') 99 { /* likely */ } 100 else 101 return pszTag[1] == 'i' 102 && pszTag[2] == 'l' 103 && pszTag[3] == 'l' 104 && pszTag[4] == '-' 105 && pszTag[5] == 'l' 106 && pszTag[6] == 'e' 107 && pszTag[7] == 'a' 108 && pszTag[8] == 'k'; 109 if (ch != 'm') 110 return false; 111 return pszTag[1] == 'm' 112 && pszTag[2] == 'a' 113 && pszTag[3] == 'y' 114 && pszTag[4] == '-' 115 && pszTag[5] == 'l' 116 && pszTag[6] == 'e' 117 && pszTag[7] == 'a' 118 && pszTag[8] == 'k'; 119 } 120 #endif /* VBOX_WITH_GCC_SANITIZER */ 121 122 88 123 RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF 89 124 { … … 123 158 , ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT)); 124 159 #endif /* !RTALLOC_USE_EFENCE */ 160 #ifdef VBOX_WITH_GCC_SANITIZER 161 if (rtMemIsLeakTag(pszTag)) 162 __lsan_ignore_object(pv); 163 #endif 125 164 return pv; 126 165 } … … 147 186 , ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT)); 148 187 #endif /* !RTALLOC_USE_EFENCE */ 188 #ifdef VBOX_WITH_GCC_SANITIZER 189 if (rtMemIsLeakTag(pszTag)) 190 __lsan_ignore_object(pv); 191 #endif 149 192 return pv; 150 193 }
Note:
See TracChangeset
for help on using the changeset viewer.