[PATCH] D46408: [sanitizer] s/TestOnlyInit/Init for the allocator ByteMap (NFC)
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 7 12:05:57 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT331662: [sanitizer] s/TestOnlyInit/Init for the allocator ByteMap (NFC) (authored by cryptoad, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D46408?vs=145089&id=145513#toc
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D46408
Files:
lib/sanitizer_common/sanitizer_allocator_bytemap.h
lib/sanitizer_common/sanitizer_allocator_primary32.h
lib/sanitizer_common/tests/sanitizer_allocator_test.cc
Index: lib/sanitizer_common/sanitizer_allocator_bytemap.h
===================================================================
--- lib/sanitizer_common/sanitizer_allocator_bytemap.h
+++ 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 @@
template <u64 kSize1, u64 kSize2, class MapUnmapCallback = NoOpMapUnmapCallback>
class TwoLevelByteMap {
public:
- void TestOnlyInit() {
+ void Init() {
internal_memset(map1_, 0, sizeof(map1_));
mu_.Init();
}
Index: lib/sanitizer_common/sanitizer_allocator_primary32.h
===================================================================
--- lib/sanitizer_common/sanitizer_allocator_primary32.h
+++ lib/sanitizer_common/sanitizer_allocator_primary32.h
@@ -108,7 +108,7 @@
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));
}
Index: lib/sanitizer_common/tests/sanitizer_allocator_test.cc
===================================================================
--- lib/sanitizer_common/tests/sanitizer_allocator_test.cc
+++ lib/sanitizer_common/tests/sanitizer_allocator_test.cc
@@ -1289,7 +1289,7 @@
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 @@
TEST(SanitizerCommon, ThreadedTwoLevelByteMap) {
TestByteMap m;
- m.TestOnlyInit();
+ m.Init();
TestMapUnmapCallback::map_count = 0;
TestMapUnmapCallback::unmap_count = 0;
static const int kNumThreads = 4;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46408.145513.patch
Type: text/x-patch
Size: 1915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180507/082dff3d/attachment.bin>
More information about the llvm-commits
mailing list