Home
last modified time | relevance | path

Searched refs:scudo (Results 1 – 25 of 167) sorted by relevance

1234567

/external/llvm-project/compiler-rt/lib/scudo/standalone/tests/
Drelease_test.cpp22 for (scudo::uptr I = 0; I < SCUDO_WORDSIZE; I++) { in TEST()
24 scudo::PackedCounterArray Counters2N(1U, 1U, 1UL << I); in TEST()
25 EXPECT_EQ(sizeof(scudo::uptr), Counters2N.getBufferSize()); in TEST()
27 scudo::PackedCounterArray Counters2N1_1(1U, 1U, ~0UL >> I); in TEST()
28 EXPECT_EQ(sizeof(scudo::uptr), Counters2N1_1.getBufferSize()); in TEST()
31 scudo::PackedCounterArray Counters(1U, SCUDO_WORDSIZE, 1UL << I); in TEST()
32 EXPECT_EQ(sizeof(scudo::uptr) * scudo::roundUpToPowerOfTwo(I + 1), in TEST()
37 for (scudo::uptr I = 0; (SCUDO_WORDSIZE >> I) != 0; I++) { in TEST()
39 const scudo::uptr NumCounters = in TEST()
40 (scudo::getPageSizeCached() / 8) * (SCUDO_WORDSIZE >> I); in TEST()
[all …]
Dchecksum_test.cpp15 scudo::u16 computeSoftwareChecksum(scudo::u32 Seed, scudo::uptr *Array, in computeSoftwareChecksum()
16 scudo::uptr ArraySize) { in computeSoftwareChecksum()
17 scudo::u16 Checksum = static_cast<scudo::u16>(Seed & 0xffff); in computeSoftwareChecksum()
18 for (scudo::uptr I = 0; I < ArraySize; I++) in computeSoftwareChecksum()
19 Checksum = scudo::computeBSDChecksum(Checksum, Array[I]); in computeSoftwareChecksum()
23 scudo::u16 computeHardwareChecksum(scudo::u32 Seed, scudo::uptr *Array, in computeHardwareChecksum()
24 scudo::uptr ArraySize) { in computeHardwareChecksum()
25 scudo::u32 Crc = Seed; in computeHardwareChecksum()
26 for (scudo::uptr I = 0; I < ArraySize; I++) in computeHardwareChecksum()
27 Crc = scudo::computeHardwareCRC32(Crc, Array[I]); in computeHardwareChecksum()
[all …]
Dcombined_test.cpp25 static constexpr scudo::Chunk::Origin Origin = scudo::Chunk::Origin::Malloc;
37 bool isTaggedAllocation(AllocatorT *Allocator, scudo::uptr Size, in isTaggedAllocation()
38 scudo::uptr Alignment) { in isTaggedAllocation()
40 !scudo::systemDetectsMemoryTagFaultsTestOnly()) in isTaggedAllocation()
43 const scudo::uptr MinAlignment = 1UL << SCUDO_MIN_ALIGNMENT_LOG; in isTaggedAllocation()
46 const scudo::uptr NeededSize = in isTaggedAllocation()
47 scudo::roundUpTo(Size, MinAlignment) + in isTaggedAllocation()
48 ((Alignment > MinAlignment) ? Alignment : scudo::Chunk::getHeaderSize()); in isTaggedAllocation()
53 void checkMemoryTaggingMaybe(AllocatorT *Allocator, void *P, scudo::uptr Size, in checkMemoryTaggingMaybe()
54 scudo::uptr Alignment) { in checkMemoryTaggingMaybe()
[all …]
Dchunk_test.cpp15 static constexpr scudo::uptr HeaderSize = scudo::Chunk::getHeaderSize();
16 static constexpr scudo::u32 Cookie = 0x41424344U;
17 static constexpr scudo::u32 InvalidCookie = 0x11223344U;
20 if (&scudo::computeHardwareCRC32 && scudo::hasHardwareCRC32()) in initChecksum()
21 scudo::HashAlgorithm = scudo::Checksum::HardwareCRC32; in initChecksum()
26 const scudo::uptr Size = 0x100U; in TEST()
27 scudo::Chunk::UnpackedHeader Header = {}; in TEST()
29 void *P = reinterpret_cast<void *>(reinterpret_cast<scudo::uptr>(Block) + in TEST()
31 scudo::Chunk::storeHeader(Cookie, P, &Header); in TEST()
33 scudo::Chunk::loadHeader(Cookie, P, &Header); in TEST()
[all …]
Dflags_test.cpp20 static void testFlag(scudo::FlagType Type, T StartValue, const char *Env, in testFlag()
22 scudo::FlagParser Parser; in testFlag()
28 scudo::reportUnrecognizedFlags(); in testFlag()
32 testFlag(scudo::FlagType::FT_bool, false, "flag_name=1", true); in TEST()
33 testFlag(scudo::FlagType::FT_bool, false, "flag_name=yes", true); in TEST()
34 testFlag(scudo::FlagType::FT_bool, false, "flag_name='yes'", true); in TEST()
35 testFlag(scudo::FlagType::FT_bool, false, "flag_name=true", true); in TEST()
36 testFlag(scudo::FlagType::FT_bool, true, "flag_name=0", false); in TEST()
37 testFlag(scudo::FlagType::FT_bool, true, "flag_name=\"0\"", false); in TEST()
38 testFlag(scudo::FlagType::FT_bool, true, "flag_name=no", false); in TEST()
[all …]
Dreport_test.cpp16 EXPECT_DEATH(scudo::reportError("TEST123"), "Scudo ERROR.*TEST123"); in TEST()
17 EXPECT_DEATH(scudo::reportInvalidFlag("ABC", "DEF"), "Scudo ERROR.*ABC.*DEF"); in TEST()
18 EXPECT_DEATH(scudo::reportHeaderCorruption(P), "Scudo ERROR.*42424242"); in TEST()
19 EXPECT_DEATH(scudo::reportHeaderRace(P), "Scudo ERROR.*42424242"); in TEST()
20 EXPECT_DEATH(scudo::reportSanityCheckError("XYZ"), "Scudo ERROR.*XYZ"); in TEST()
21 EXPECT_DEATH(scudo::reportAlignmentTooBig(123, 456), "Scudo ERROR.*123.*456"); in TEST()
22 EXPECT_DEATH(scudo::reportAllocationSizeTooBig(123, 456, 789), in TEST()
24 EXPECT_DEATH(scudo::reportOutOfMemory(4242), "Scudo ERROR.*4242"); in TEST()
26 scudo::reportInvalidChunkState(scudo::AllocatorAction::Recycling, P), in TEST()
29 scudo::reportInvalidChunkState(scudo::AllocatorAction::Sizing, P), in TEST()
[all …]
Dmap_test.cpp19 EXPECT_EQ(scudo::getPageSizeCached(), in TEST()
20 static_cast<scudo::uptr>(getpagesize())); in TEST()
24 const scudo::uptr Size = 4 * scudo::getPageSizeCached(); in TEST()
25 scudo::MapPlatformData Data = {}; in TEST()
26 void *P = scudo::map(nullptr, Size, MappingName, MAP_NOACCESS, &Data); in TEST()
29 scudo::unmap(P, Size, UNMAP_ALL, &Data); in TEST()
33 const scudo::uptr Size = 4 * scudo::getPageSizeCached(); in TEST()
34 void *P = scudo::map(nullptr, Size, MappingName, 0, nullptr); in TEST()
37 scudo::unmap(P, Size, 0, nullptr); in TEST()
42 const scudo::uptr PageSize = scudo::getPageSizeCached(); in TEST()
[all …]
Dsecondary_test.cpp22 scudo::GlobalStats S; in testSecondaryBasic()
26 const scudo::uptr Size = 1U << 16; in testSecondaryBasic()
36 const scudo::uptr Align = 1U << 16; in testSecondaryBasic()
40 scudo::roundUpTo(reinterpret_cast<scudo::uptr>(P), Align)); in testSecondaryBasic()
45 for (scudo::uptr I = 0; I < 32U; I++) in testSecondaryBasic()
52 scudo::ScopedString Str(1024); in testSecondaryBasic()
58 testSecondaryBasic<scudo::MapAllocator<scudo::MapAllocatorNoCache>>(); in TEST()
59 testSecondaryBasic<scudo::MapAllocator<scudo::MapAllocatorCache<>>>(); in TEST()
61 scudo::MapAllocator<scudo::MapAllocatorCache<128U, 64U, 1UL << 20>>>(); in TEST()
64 using LargeAllocator = scudo::MapAllocator<scudo::MapAllocatorCache<>>;
[all …]
Dstats_test.cpp14 scudo::LocalStats LStats; in TEST()
16 for (scudo::uptr I = 0; I < scudo::StatCount; I++) in TEST()
17 EXPECT_EQ(LStats.get(static_cast<scudo::StatType>(I)), 0U); in TEST()
18 LStats.add(scudo::StatAllocated, 4096U); in TEST()
19 EXPECT_EQ(LStats.get(scudo::StatAllocated), 4096U); in TEST()
20 LStats.sub(scudo::StatAllocated, 4096U); in TEST()
21 EXPECT_EQ(LStats.get(scudo::StatAllocated), 0U); in TEST()
22 LStats.set(scudo::StatAllocated, 4096U); in TEST()
23 EXPECT_EQ(LStats.get(scudo::StatAllocated), 4096U); in TEST()
27 scudo::GlobalStats GStats; in TEST()
[all …]
Dprimary_test.cpp25 const scudo::uptr NumberOfAllocations = 32U; in testPrimary()
34 for (scudo::uptr I = 0; I <= 16U; I++) { in testPrimary()
35 const scudo::uptr Size = 1UL << I; in testPrimary()
38 const scudo::uptr ClassId = Primary::SizeClassMap::getClassIdBySize(Size); in testPrimary()
40 for (scudo::uptr J = 0; J < NumberOfAllocations; J++) { in testPrimary()
45 for (scudo::uptr J = 0; J < NumberOfAllocations; J++) in testPrimary()
50 scudo::ScopedString Str(1024); in testPrimary()
56 using SizeClassMap = scudo::DefaultSizeClassMap; in TEST()
58 testPrimary<scudo::SizeClassAllocator32<SizeClassMap, 18U>>(); in TEST()
60 testPrimary<scudo::SizeClassAllocator64<SizeClassMap, 24U>>(); in TEST()
[all …]
Dsize_class_map_test.cpp15 scudo::printMap<SCMap>(); in testSizeClassMap()
16 scudo::validateMap<SCMap>(); in testSizeClassMap()
20 testSizeClassMap<scudo::DefaultSizeClassMap>(); in TEST()
24 testSizeClassMap<scudo::SvelteSizeClassMap>(); in TEST()
28 testSizeClassMap<scudo::AndroidSizeClassMap>(); in TEST()
32 static const scudo::uptr NumBits = 1;
33 static const scudo::uptr MinSizeLog = 5;
34 static const scudo::uptr MidSizeLog = 5;
35 static const scudo::uptr MaxSizeLog = 5;
36 static const scudo::u32 MaxNumCachedHint = 0;
[all …]
/external/scudo/standalone/tests/
Drelease_test.cpp22 for (scudo::uptr I = 0; I < SCUDO_WORDSIZE; I++) { in TEST()
24 scudo::PackedCounterArray Counters2N(1U, 1U, 1UL << I); in TEST()
25 EXPECT_EQ(sizeof(scudo::uptr), Counters2N.getBufferSize()); in TEST()
27 scudo::PackedCounterArray Counters2N1_1(1U, 1U, ~0UL >> I); in TEST()
28 EXPECT_EQ(sizeof(scudo::uptr), Counters2N1_1.getBufferSize()); in TEST()
31 scudo::PackedCounterArray Counters(1U, SCUDO_WORDSIZE, 1UL << I); in TEST()
32 EXPECT_EQ(sizeof(scudo::uptr) * scudo::roundUpToPowerOfTwo(I + 1), in TEST()
37 for (scudo::uptr I = 0; (SCUDO_WORDSIZE >> I) != 0; I++) { in TEST()
39 const scudo::uptr NumCounters = in TEST()
40 (scudo::getPageSizeCached() / 8) * (SCUDO_WORDSIZE >> I); in TEST()
[all …]
Dchecksum_test.cpp15 scudo::u16 computeSoftwareChecksum(scudo::u32 Seed, scudo::uptr *Array, in computeSoftwareChecksum()
16 scudo::uptr ArraySize) { in computeSoftwareChecksum()
17 scudo::u16 Checksum = static_cast<scudo::u16>(Seed & 0xffff); in computeSoftwareChecksum()
18 for (scudo::uptr I = 0; I < ArraySize; I++) in computeSoftwareChecksum()
19 Checksum = scudo::computeBSDChecksum(Checksum, Array[I]); in computeSoftwareChecksum()
23 scudo::u16 computeHardwareChecksum(scudo::u32 Seed, scudo::uptr *Array, in computeHardwareChecksum()
24 scudo::uptr ArraySize) { in computeHardwareChecksum()
25 scudo::u32 Crc = Seed; in computeHardwareChecksum()
26 for (scudo::uptr I = 0; I < ArraySize; I++) in computeHardwareChecksum()
27 Crc = scudo::computeHardwareCRC32(Crc, Array[I]); in computeHardwareChecksum()
[all …]
Dsecondary_test.cpp23 using SecondaryT = scudo::MapAllocator<Config>; in testSecondaryBasic()
25 scudo::GlobalStats S; in testSecondaryBasic()
29 const scudo::uptr Size = 1U << 16; in testSecondaryBasic()
30 void *P = L->allocate(scudo::Options{}, Size); in testSecondaryBasic()
34 L->deallocate(scudo::Options{}, P); in testSecondaryBasic()
39 const scudo::uptr Align = 1U << 16; in testSecondaryBasic()
40 P = L->allocate(scudo::Options{}, Size + Align, Align); in testSecondaryBasic()
43 scudo::roundUpTo(reinterpret_cast<scudo::uptr>(P), Align)); in testSecondaryBasic()
45 L->deallocate(scudo::Options{}, P); in testSecondaryBasic()
48 for (scudo::uptr I = 0; I < 32U; I++) in testSecondaryBasic()
[all …]
Dchunk_test.cpp15 static constexpr scudo::uptr HeaderSize = scudo::Chunk::getHeaderSize();
16 static constexpr scudo::u32 Cookie = 0x41424344U;
17 static constexpr scudo::u32 InvalidCookie = 0x11223344U;
20 if (&scudo::computeHardwareCRC32 && scudo::hasHardwareCRC32()) in initChecksum()
21 scudo::HashAlgorithm = scudo::Checksum::HardwareCRC32; in initChecksum()
26 const scudo::uptr Size = 0x100U; in TEST()
27 scudo::Chunk::UnpackedHeader Header = {}; in TEST()
29 void *P = reinterpret_cast<void *>(reinterpret_cast<scudo::uptr>(Block) + in TEST()
31 scudo::Chunk::storeHeader(Cookie, P, &Header); in TEST()
33 scudo::Chunk::loadHeader(Cookie, P, &Header); in TEST()
[all …]
Dcombined_test.cpp22 static constexpr scudo::Chunk::Origin Origin = scudo::Chunk::Origin::Malloc;
23 static constexpr scudo::uptr MinAlignLog = FIRST_32_SECOND_64(3U, 4U);
35 bool isPrimaryAllocation(scudo::uptr Size, scudo::uptr Alignment) { in isPrimaryAllocation()
36 const scudo::uptr MinAlignment = 1UL << SCUDO_MIN_ALIGNMENT_LOG; in isPrimaryAllocation()
39 const scudo::uptr NeededSize = in isPrimaryAllocation()
40 scudo::roundUpTo(Size, MinAlignment) + in isPrimaryAllocation()
41 ((Alignment > MinAlignment) ? Alignment : scudo::Chunk::getHeaderSize()); in isPrimaryAllocation()
46 void checkMemoryTaggingMaybe(AllocatorT *Allocator, void *P, scudo::uptr Size, in checkMemoryTaggingMaybe()
47 scudo::uptr Alignment) { in checkMemoryTaggingMaybe()
48 const scudo::uptr MinAlignment = 1UL << SCUDO_MIN_ALIGNMENT_LOG; in checkMemoryTaggingMaybe()
[all …]
Dflags_test.cpp20 static void testFlag(scudo::FlagType Type, T StartValue, const char *Env, in testFlag()
22 scudo::FlagParser Parser; in testFlag()
28 scudo::reportUnrecognizedFlags(); in testFlag()
32 testFlag(scudo::FlagType::FT_bool, false, "flag_name=1", true); in TEST()
33 testFlag(scudo::FlagType::FT_bool, false, "flag_name=yes", true); in TEST()
34 testFlag(scudo::FlagType::FT_bool, false, "flag_name='yes'", true); in TEST()
35 testFlag(scudo::FlagType::FT_bool, false, "flag_name=true", true); in TEST()
36 testFlag(scudo::FlagType::FT_bool, true, "flag_name=0", false); in TEST()
37 testFlag(scudo::FlagType::FT_bool, true, "flag_name=\"0\"", false); in TEST()
38 testFlag(scudo::FlagType::FT_bool, true, "flag_name=no", false); in TEST()
[all …]
Dreport_test.cpp16 EXPECT_DEATH(scudo::reportError("TEST123"), "Scudo ERROR.*TEST123"); in TEST()
17 EXPECT_DEATH(scudo::reportInvalidFlag("ABC", "DEF"), "Scudo ERROR.*ABC.*DEF"); in TEST()
18 EXPECT_DEATH(scudo::reportHeaderCorruption(P), "Scudo ERROR.*42424242"); in TEST()
19 EXPECT_DEATH(scudo::reportHeaderRace(P), "Scudo ERROR.*42424242"); in TEST()
20 EXPECT_DEATH(scudo::reportSanityCheckError("XYZ"), "Scudo ERROR.*XYZ"); in TEST()
21 EXPECT_DEATH(scudo::reportAlignmentTooBig(123, 456), "Scudo ERROR.*123.*456"); in TEST()
22 EXPECT_DEATH(scudo::reportAllocationSizeTooBig(123, 456, 789), in TEST()
24 EXPECT_DEATH(scudo::reportOutOfMemory(4242), "Scudo ERROR.*4242"); in TEST()
26 scudo::reportInvalidChunkState(scudo::AllocatorAction::Recycling, P), in TEST()
29 scudo::reportInvalidChunkState(scudo::AllocatorAction::Sizing, P), in TEST()
[all …]
Dmap_test.cpp19 EXPECT_EQ(scudo::getPageSizeCached(), in TEST()
20 static_cast<scudo::uptr>(getpagesize())); in TEST()
24 const scudo::uptr Size = 4 * scudo::getPageSizeCached(); in TEST()
25 scudo::MapPlatformData Data = {}; in TEST()
26 void *P = scudo::map(nullptr, Size, MappingName, MAP_NOACCESS, &Data); in TEST()
29 scudo::unmap(P, Size, UNMAP_ALL, &Data); in TEST()
33 const scudo::uptr Size = 4 * scudo::getPageSizeCached(); in TEST()
34 void *P = scudo::map(nullptr, Size, MappingName, 0, nullptr); in TEST()
37 scudo::unmap(P, Size, 0, nullptr); in TEST()
42 const scudo::uptr PageSize = scudo::getPageSizeCached(); in TEST()
[all …]
Dstats_test.cpp14 scudo::LocalStats LStats; in TEST()
16 for (scudo::uptr I = 0; I < scudo::StatCount; I++) in TEST()
17 EXPECT_EQ(LStats.get(static_cast<scudo::StatType>(I)), 0U); in TEST()
18 LStats.add(scudo::StatAllocated, 4096U); in TEST()
19 EXPECT_EQ(LStats.get(scudo::StatAllocated), 4096U); in TEST()
20 LStats.sub(scudo::StatAllocated, 4096U); in TEST()
21 EXPECT_EQ(LStats.get(scudo::StatAllocated), 0U); in TEST()
22 LStats.set(scudo::StatAllocated, 4096U); in TEST()
23 EXPECT_EQ(LStats.get(scudo::StatAllocated), 4096U); in TEST()
27 scudo::GlobalStats GStats; in TEST()
[all …]
Dprimary_test.cpp26 static const scudo::uptr PrimaryRegionSizeLog = 18U;
27 static const scudo::s32 PrimaryMinReleaseToOsIntervalMs = INT32_MIN;
28 static const scudo::s32 PrimaryMaxReleaseToOsIntervalMs = INT32_MAX;
30 typedef scudo::uptr PrimaryCompactPtrT;
31 static const scudo::uptr PrimaryCompactPtrScale = 0;
35 static const scudo::uptr PrimaryRegionSizeLog = 24U;
36 static const scudo::s32 PrimaryMinReleaseToOsIntervalMs = INT32_MIN;
37 static const scudo::s32 PrimaryMaxReleaseToOsIntervalMs = INT32_MAX;
39 typedef scudo::uptr PrimaryCompactPtrT;
40 static const scudo::uptr PrimaryCompactPtrScale = 0;
[all …]
Dsize_class_map_test.cpp15 scudo::printMap<SCMap>(); in testSizeClassMap()
16 scudo::validateMap<SCMap>(); in testSizeClassMap()
20 testSizeClassMap<scudo::DefaultSizeClassMap>(); in TEST()
24 testSizeClassMap<scudo::SvelteSizeClassMap>(); in TEST()
28 testSizeClassMap<scudo::AndroidSizeClassMap>(); in TEST()
32 static const scudo::uptr NumBits = 1;
33 static const scudo::uptr MinSizeLog = 5;
34 static const scudo::uptr MidSizeLog = 5;
35 static const scudo::uptr MaxSizeLog = 5;
36 static const scudo::u32 MaxNumCachedHint = 0;
[all …]
/external/scudo/standalone/
Dwrappers_cpp.cpp19 extern HIDDEN scudo::Allocator<scudo::Config, malloc_postinit> Allocator;
27 return Allocator.allocate(size, scudo::Chunk::Origin::New); in operator new()
30 return Allocator.allocate(size, scudo::Chunk::Origin::NewArray); in operator new[]()
34 return Allocator.allocate(size, scudo::Chunk::Origin::New); in operator new()
38 return Allocator.allocate(size, scudo::Chunk::Origin::NewArray); in operator new[]()
41 return Allocator.allocate(size, scudo::Chunk::Origin::New, in operator new()
42 static_cast<scudo::uptr>(align)); in operator new()
45 return Allocator.allocate(size, scudo::Chunk::Origin::NewArray, in operator new[]()
46 static_cast<scudo::uptr>(align)); in operator new[]()
50 return Allocator.allocate(size, scudo::Chunk::Origin::New, in operator new()
[all …]
/external/llvm-project/compiler-rt/lib/scudo/standalone/
Dwrappers_cpp.cpp19 extern HIDDEN scudo::Allocator<scudo::Config, malloc_postinit> Allocator;
27 return Allocator.allocate(size, scudo::Chunk::Origin::New); in operator new()
30 return Allocator.allocate(size, scudo::Chunk::Origin::NewArray); in operator new[]()
34 return Allocator.allocate(size, scudo::Chunk::Origin::New); in operator new()
38 return Allocator.allocate(size, scudo::Chunk::Origin::NewArray); in operator new[]()
41 return Allocator.allocate(size, scudo::Chunk::Origin::New, in operator new()
42 static_cast<scudo::uptr>(align)); in operator new()
45 return Allocator.allocate(size, scudo::Chunk::Origin::NewArray, in operator new[]()
46 static_cast<scudo::uptr>(align)); in operator new[]()
50 return Allocator.allocate(size, scudo::Chunk::Origin::New, in operator new()
[all …]
Dwrappers_c.inc23 scudo::uptr Product;
24 if (UNLIKELY(scudo::checkForCallocOverflow(size, nmemb, &Product))) {
29 scudo::reportCallocOverflow(nmemb, size);
31 return scudo::setErrnoOnNull(SCUDO_ALLOCATOR.allocate(
32 Product, scudo::Chunk::Origin::Malloc, SCUDO_MALLOC_ALIGNMENT, true));
36 SCUDO_ALLOCATOR.deallocate(ptr, scudo::Chunk::Origin::Malloc);
41 scudo::StatCounters Stats;
44 Info.hblkhd = static_cast<__scudo_mallinfo_data_t>(Stats[scudo::StatMapped]);
48 Info.fsmblks = static_cast<__scudo_mallinfo_data_t>(Stats[scudo::StatFree]);
51 static_cast<__scudo_mallinfo_data_t>(Stats[scudo::StatAllocated]);
[all …]

1234567