diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2018-05-07 19:02:19 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2018-05-07 19:02:19 +0000 |
commit | 440d76c5597c5f56ce2d1099d072282cb918818a (patch) | |
tree | a096447b6c907016ff174b2d64263c78cf1f6736 /compiler-rt | |
parent | 23b242f91060c36539a0aec091b73fe4b0dd7a1f (diff) | |
download | bcm5719-llvm-440d76c5597c5f56ce2d1099d072282cb918818a.tar.gz bcm5719-llvm-440d76c5597c5f56ce2d1099d072282cb918818a.zip |
[sanitizer] s/TestOnlyInit/Init for the allocator ByteMap (NFC)
Summary:
The `TestOnlyInit` function of `{Flat,TwoLevel}ByteMap` seems to be a misnomer
since the function is used outside of tests as well, namely in
`SizeClassAllocator32::Init`. Rename it to `Init` and update the callers.
Reviewers: alekseyshl, vitalybuka
Reviewed By: vitalybuka
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D46408
llvm-svn: 331662
Diffstat (limited to 'compiler-rt')
3 files changed, 5 insertions, 5 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_bytemap.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_bytemap.h index 92472cdf515..7df3e4097bf 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_bytemap.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_bytemap.h @@ -18,7 +18,7 @@ template<u64 kSize> class FlatByteMap { public: - void TestOnlyInit() { + void Init() { internal_memset(map_, 0, sizeof(map_)); } @@ -44,7 +44,7 @@ class FlatByteMap { template <u64 kSize1, u64 kSize2, class MapUnmapCallback = NoOpMapUnmapCallback> class TwoLevelByteMap { public: - void TestOnlyInit() { + void Init() { internal_memset(map1_, 0, sizeof(map1_)); mu_.Init(); } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h index ca78cad3533..7883ed028e5 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h @@ -108,7 +108,7 @@ class SizeClassAllocator32 { typedef SizeClassAllocator32LocalCache<ThisT> AllocatorCache; void Init(s32 release_to_os_interval_ms) { - possible_regions.TestOnlyInit(); + possible_regions.Init(); internal_memset(size_class_info_array, 0, sizeof(size_class_info_array)); } diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc index e79d1215936..ef4c10b8de5 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc @@ -1289,7 +1289,7 @@ TEST(SanitizerCommon, TwoLevelByteMap) { const u64 kSize1 = 1 << 6, kSize2 = 1 << 12; const u64 n = kSize1 * kSize2; TwoLevelByteMap<kSize1, kSize2> m; - m.TestOnlyInit(); + m.Init(); for (u64 i = 0; i < n; i += 7) { m.set(i, (i % 100) + 1); } @@ -1324,7 +1324,7 @@ void *TwoLevelByteMapUserThread(void *param) { TEST(SanitizerCommon, ThreadedTwoLevelByteMap) { TestByteMap m; - m.TestOnlyInit(); + m.Init(); TestMapUnmapCallback::map_count = 0; TestMapUnmapCallback::unmap_count = 0; static const int kNumThreads = 4; |