Skip to content

Commit 39c0602

Browse files
committed
[lsan] Rename IgnoreObjectLocked into IgnoreObject
We don't lock allocator for this call.
1 parent 7d32866 commit 39c0602

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

compiler-rt/lib/asan/asan_allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ void ForEachChunk(ForEachChunkCallback callback, void *arg) {
11441144
__asan::get_allocator().ForEachChunk(callback, arg);
11451145
}
11461146

1147-
IgnoreObjectResult IgnoreObjectLocked(const void *p) {
1147+
IgnoreObjectResult IgnoreObject(const void *p) {
11481148
uptr addr = reinterpret_cast<uptr>(p);
11491149
__asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddr(addr);
11501150
if (!m ||

compiler-rt/lib/hwasan/hwasan_allocator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,10 @@ void ForEachChunk(ForEachChunkCallback callback, void *arg) {
618618
__hwasan::allocator.ForEachChunk(callback, arg);
619619
}
620620

621-
IgnoreObjectResult IgnoreObjectLocked(const void *p) {
621+
IgnoreObjectResult IgnoreObject(const void *p) {
622622
p = __hwasan::InTaggableRegion(reinterpret_cast<uptr>(p)) ? UntagPtr(p) : p;
623623
uptr addr = reinterpret_cast<uptr>(p);
624-
uptr chunk =
625-
reinterpret_cast<uptr>(__hwasan::allocator.GetBlockBegin(p));
624+
uptr chunk = reinterpret_cast<uptr>(__hwasan::allocator.GetBlockBegin(p));
626625
if (!chunk)
627626
return kIgnoreObjectInvalid;
628627
__hwasan::Metadata *metadata = reinterpret_cast<__hwasan::Metadata *>(

compiler-rt/lib/lsan/lsan_allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void ForEachChunk(ForEachChunkCallback callback, void *arg) {
324324
allocator.ForEachChunk(callback, arg);
325325
}
326326

327-
IgnoreObjectResult IgnoreObjectLocked(const void *p) {
327+
IgnoreObjectResult IgnoreObject(const void *p) {
328328
void *chunk = allocator.GetBlockBegin(p);
329329
if (!chunk || p < chunk) return kIgnoreObjectInvalid;
330330
ChunkMetadata *m = Metadata(chunk);

compiler-rt/lib/lsan/lsan_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ void __lsan_ignore_object(const void *p) {
997997
// Cannot use PointsIntoChunk or LsanMetadata here, since the allocator is not
998998
// locked.
999999
Lock l(&global_mutex);
1000-
IgnoreObjectResult res = IgnoreObjectLocked(p);
1000+
IgnoreObjectResult res = IgnoreObject(p);
10011001
if (res == kIgnoreObjectInvalid)
10021002
VReport(1, "__lsan_ignore_object(): no heap object found at %p\n", p);
10031003
if (res == kIgnoreObjectAlreadyIgnored)

compiler-rt/lib/lsan/lsan_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class LsanMetadata {
154154
void ForEachChunk(ForEachChunkCallback callback, void *arg);
155155

156156
// Helper for __lsan_ignore_object().
157-
IgnoreObjectResult IgnoreObjectLocked(const void *p);
157+
IgnoreObjectResult IgnoreObject(const void *p);
158158

159159
// The rest of the LSan interface which is implemented by library.
160160

0 commit comments

Comments
 (0)