summaryrefslogtreecommitdiff
path: root/lib/scudo/scudo_utils.h
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2017-12-08 16:36:37 +0000
committerKostya Kortchinsky <kostyak@google.com>2017-12-08 16:36:37 +0000
commit3ac17efee8234daf31ab3275eaf02ef175deb467 (patch)
tree641f8fe953ca51d79c8e376029a8233c845537c5 /lib/scudo/scudo_utils.h
parent54a1331a5027f748f0088ef64d010dafc8f6e23e (diff)
[scudo] Minor code generation improvement
Summary: It looks like clang was generating somewhat weird assembly with the current code. `FromPrimary`, even though `const`, was replaced every time with the code generated for `size <= SizeClassMap::kMaxSize` instead of using a variable or register, and `FromPrimary` didn't induce `ClassId != 0` for the compiler, so a dead branch was generated for `getActuallyAllocatedSize(Ptr, ClassId)` since it's never called for `ClassId = 0` (Secondary backed allocations) [this one was more wishful thinking on my side than anything else]. I rearranged the code bit so that the generated assembly is less clunky. Also changed 2 whitespace inconsistencies that were bothering me. Reviewers: alekseyshl, flowerhack Reviewed By: flowerhack Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D40976 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/scudo/scudo_utils.h')
-rw-r--r--lib/scudo/scudo_utils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/scudo/scudo_utils.h b/lib/scudo/scudo_utils.h
index 320eced34..43448e083 100644
--- a/lib/scudo/scudo_utils.h
+++ b/lib/scudo/scudo_utils.h
@@ -31,6 +31,7 @@ INLINE Dest bit_cast(const Source& source) {
void NORETURN dieWithMessage(const char *Format, ...);
bool hasHardwareCRC32();
+
} // namespace __scudo
#endif // SCUDO_UTILS_H_