diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-07-04 10:07:39 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-07-04 10:07:39 +0000 |
| commit | 50498e114fe833ccf3b57eb77df4b83b11a15af0 (patch) | |
| tree | 52bf988511375e0638140ea235d9bcf9bb896045 | |
| parent | ae0fc23f8d70d275a18c4d9e85ccc7b70f3aad55 (diff) | |
| download | bcm5719-llvm-50498e114fe833ccf3b57eb77df4b83b11a15af0.tar.gz bcm5719-llvm-50498e114fe833ccf3b57eb77df4b83b11a15af0.zip | |
[msan] Reformat one source file.
llvm-svn: 212329
| -rw-r--r-- | compiler-rt/lib/msan/msan_allocator.cc | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/compiler-rt/lib/msan/msan_allocator.cc b/compiler-rt/lib/msan/msan_allocator.cc index af509642fa7..cb8af279d7d 100644 --- a/compiler-rt/lib/msan/msan_allocator.cc +++ b/compiler-rt/lib/msan/msan_allocator.cc @@ -116,7 +116,7 @@ void MsanDeallocate(StackTrace *stack, void *p) { CHECK(p); Init(); MSAN_FREE_HOOK(p); - Metadata *meta = reinterpret_cast<Metadata*>(allocator.GetMetaData(p)); + Metadata *meta = reinterpret_cast<Metadata *>(allocator.GetMetaData(p)); uptr size = meta->requested_size; meta->requested_size = 0; // This memory will not be reused by anyone else, so we are free to keep it @@ -128,7 +128,7 @@ void MsanDeallocate(StackTrace *stack, void *p) { CHECK(stack_id); u32 id; ChainedOriginDepotPut(stack_id, Origin::kHeapRoot, &id); - __msan_set_origin(p, size, Origin(id, 1).raw_id()); + __msan_set_origin(p, size, Origin(id, 1).raw_id()); } } MsanThread *t = GetCurrentThread(); @@ -171,12 +171,10 @@ void *MsanReallocate(StackTrace *stack, void *old_p, uptr new_size, } static uptr AllocationSize(const void *p) { - if (p == 0) - return 0; + if (p == 0) return 0; const void *beg = allocator.GetBlockBegin(p); - if (beg != p) - return 0; - Metadata *b = (Metadata*)allocator.GetMetaData(p); + if (beg != p) return 0; + Metadata *b = (Metadata *)allocator.GetMetaData(p); return b->requested_size; } @@ -196,22 +194,12 @@ uptr __msan_get_heap_size() { return stats[AllocatorStatMapped]; } -uptr __msan_get_free_bytes() { - return 1; -} +uptr __msan_get_free_bytes() { return 1; } -uptr __msan_get_unmapped_bytes() { - return 1; -} +uptr __msan_get_unmapped_bytes() { return 1; } -uptr __msan_get_estimated_allocated_size(uptr size) { - return size; -} +uptr __msan_get_estimated_allocated_size(uptr size) { return size; } -int __msan_get_ownership(const void *p) { - return AllocationSize(p) != 0; -} +int __msan_get_ownership(const void *p) { return AllocationSize(p) != 0; } -uptr __msan_get_allocated_size(const void *p) { - return AllocationSize(p); -} +uptr __msan_get_allocated_size(const void *p) { return AllocationSize(p); } |

