Changeset 72613 in vbox for trunk/src/VBox/Runtime/r3
- Timestamp:
- Jun 19, 2018 1:16:32 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123111
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.