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 | 5f6822216b228c4b36b2e70839b671fa9606f7ab (patch) | |
tree | e6088d6d1d3bcc3475472f6ba85936325249d3e9 | |
parent | d35f02708812b1c2f9c543e66e10ed56cad48caf (diff) | |
download | compiler-rt-5f6822216b228c4b36b2e70839b671fa9606f7ab.tar.gz |
[msan] Reformat one source file.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212329 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/msan/msan_allocator.cc | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/lib/msan/msan_allocator.cc b/lib/msan/msan_allocator.cc index af509642f..cb8af279d 100644 --- a/lib/msan/msan_allocator.cc +++ b/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); } |