forked from OSchip/llvm-project
[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
This commit is contained in:
parent
bd48def3e2
commit
c027272ac2
|
@ -220,8 +220,8 @@ void MsanDeallocate(StackTrace *stack, void *p) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size,
|
static void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size,
|
||||||
uptr alignment) {
|
uptr alignment) {
|
||||||
Metadata *meta = reinterpret_cast<Metadata*>(allocator.GetMetaData(old_p));
|
Metadata *meta = reinterpret_cast<Metadata*>(allocator.GetMetaData(old_p));
|
||||||
uptr old_size = meta->requested_size;
|
uptr old_size = meta->requested_size;
|
||||||
uptr actually_allocated_size = allocator.GetActuallyAllocatedSize(old_p);
|
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;
|
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 (UNLIKELY(CheckForCallocOverflow(size, nmemb))) {
|
||||||
if (AllocatorMayReturnNull())
|
if (AllocatorMayReturnNull())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue