[compiler-rt] c027272 - [msan] Add static to some msan allocator functions
Jianzhou Zhao via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 29 21:49:58 PDT 2021
Author: Jianzhou Zhao
Date: 2021-04-30T04:49:10Z
New Revision: c027272ac260785849ae8afbb26742d5b7499ae5
URL: https://github.com/llvm/llvm-project/commit/c027272ac260785849ae8afbb26742d5b7499ae5
DIFF: https://github.com/llvm/llvm-project/commit/c027272ac260785849ae8afbb26742d5b7499ae5.diff
LOG: [msan] Add static to some msan allocator functions
This is to help review refactor the allocator code.
So it is easy to see which are the real public interfaces.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D101586
Added:
Modified:
compiler-rt/lib/msan/msan_allocator.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/msan/msan_allocator.cpp b/compiler-rt/lib/msan/msan_allocator.cpp
index 68be794106b19..a97bd8371e081 100644
--- a/compiler-rt/lib/msan/msan_allocator.cpp
+++ b/compiler-rt/lib/msan/msan_allocator.cpp
@@ -220,8 +220,8 @@ void MsanDeallocate(StackTrace *stack, void *p) {
}
}
-void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size,
- uptr alignment) {
+static void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size,
+ uptr alignment) {
Metadata *meta = reinterpret_cast<Metadata*>(allocator.GetMetaData(old_p));
uptr old_size = meta->requested_size;
uptr actually_allocated_size = allocator.GetActuallyAllocatedSize(old_p);
@@ -245,7 +245,7 @@ void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size,
return new_p;
}
-void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) {
+static void *MsanCalloc(StackTrace *stack, uptr nmemb, uptr size) {
if (UNLIKELY(CheckForCallocOverflow(size, nmemb))) {
if (AllocatorMayReturnNull())
return nullptr;
More information about the llvm-commits
mailing list