Skip to content

Commit e2a9d3f

Browse files
authored
[scudo] Remove AndroidSvelteConfig. (#66444)
This config is not actually used anywhere and it is not used on Android. Since it does not test anything not tested elsewhere, remove it. Remove the size class data associated with this config too.
1 parent f108c6c commit e2a9d3f

File tree

7 files changed

+2
-86
lines changed

7 files changed

+2
-86
lines changed

compiler-rt/lib/scudo/standalone/allocator_config.h

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -195,50 +195,6 @@ struct AndroidConfig {
195195
template <typename Config> using SecondaryT = MapAllocator<Config>;
196196
};
197197

198-
struct AndroidSvelteConfig {
199-
static const bool MaySupportMemoryTagging = false;
200-
template <class A>
201-
using TSDRegistryT = TSDRegistrySharedT<A, 2U, 1U>; // Shared, max 2 TSDs.
202-
203-
struct Primary {
204-
using SizeClassMap = SvelteSizeClassMap;
205-
#if SCUDO_CAN_USE_PRIMARY64
206-
static const uptr RegionSizeLog = 27U;
207-
typedef u32 CompactPtrT;
208-
static const uptr CompactPtrScale = SCUDO_MIN_ALIGNMENT_LOG;
209-
static const uptr GroupSizeLog = 18U;
210-
static const bool EnableRandomOffset = true;
211-
static const uptr MapSizeIncrement = 1UL << 18;
212-
#else
213-
static const uptr RegionSizeLog = 16U;
214-
static const uptr GroupSizeLog = 16U;
215-
typedef uptr CompactPtrT;
216-
#endif
217-
static const s32 MinReleaseToOsIntervalMs = 1000;
218-
static const s32 MaxReleaseToOsIntervalMs = 1000;
219-
};
220-
221-
#if SCUDO_CAN_USE_PRIMARY64
222-
template <typename Config> using PrimaryT = SizeClassAllocator64<Config>;
223-
#else
224-
template <typename Config> using PrimaryT = SizeClassAllocator32<Config>;
225-
#endif
226-
227-
struct Secondary {
228-
struct Cache {
229-
static const u32 EntriesArraySize = 16U;
230-
static const u32 QuarantineSize = 32U;
231-
static const u32 DefaultMaxEntriesCount = 4U;
232-
static const uptr DefaultMaxEntrySize = 1UL << 18;
233-
static const s32 MinReleaseToOsIntervalMs = 0;
234-
static const s32 MaxReleaseToOsIntervalMs = 0;
235-
};
236-
template <typename Config> using CacheT = MapAllocatorCache<Config>;
237-
};
238-
239-
template <typename Config> using SecondaryT = MapAllocator<Config>;
240-
};
241-
242198
#if SCUDO_CAN_USE_PRIMARY64
243199
struct FuchsiaConfig {
244200
static const bool MaySupportMemoryTagging = false;

compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ static const size_t MaxSize = 128 * 1024;
5252
// cleanly.
5353
BENCHMARK_TEMPLATE(BM_malloc_free, scudo::AndroidConfig)
5454
->Range(MinSize, MaxSize);
55-
BENCHMARK_TEMPLATE(BM_malloc_free, scudo::AndroidSvelteConfig)
56-
->Range(MinSize, MaxSize);
5755
#if SCUDO_CAN_USE_PRIMARY64
5856
BENCHMARK_TEMPLATE(BM_malloc_free, scudo::FuchsiaConfig)
5957
->Range(MinSize, MaxSize);
@@ -99,8 +97,6 @@ static const size_t MaxIters = 32 * 1024;
9997
// cleanly.
10098
BENCHMARK_TEMPLATE(BM_malloc_free_loop, scudo::AndroidConfig)
10199
->Range(MinIters, MaxIters);
102-
BENCHMARK_TEMPLATE(BM_malloc_free_loop, scudo::AndroidSvelteConfig)
103-
->Range(MinIters, MaxIters);
104100
#if SCUDO_CAN_USE_PRIMARY64
105101
BENCHMARK_TEMPLATE(BM_malloc_free_loop, scudo::FuchsiaConfig)
106102
->Range(MinIters, MaxIters);

compiler-rt/lib/scudo/standalone/size_class_map.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -289,28 +289,6 @@ typedef TableSizeClassMap<AndroidSizeClassConfig> AndroidSizeClassMap;
289289
static_assert(AndroidSizeClassMap::usesCompressedLSBFormat(), "");
290290
#endif
291291

292-
struct SvelteSizeClassConfig {
293-
#if SCUDO_WORDSIZE == 64U
294-
static const uptr NumBits = 4;
295-
static const uptr MinSizeLog = 4;
296-
static const uptr MidSizeLog = 8;
297-
static const uptr MaxSizeLog = 14;
298-
static const u16 MaxNumCachedHint = 13;
299-
static const uptr MaxBytesCachedLog = 10;
300-
static const uptr SizeDelta = Chunk::getHeaderSize();
301-
#else
302-
static const uptr NumBits = 4;
303-
static const uptr MinSizeLog = 3;
304-
static const uptr MidSizeLog = 7;
305-
static const uptr MaxSizeLog = 14;
306-
static const u16 MaxNumCachedHint = 14;
307-
static const uptr MaxBytesCachedLog = 10;
308-
static const uptr SizeDelta = Chunk::getHeaderSize();
309-
#endif
310-
};
311-
312-
typedef FixedSizeClassMap<SvelteSizeClassConfig> SvelteSizeClassMap;
313-
314292
struct TrustySizeClassConfig {
315293
static const uptr NumBits = 1;
316294
static const uptr MinSizeLog = 5;

compiler-rt/lib/scudo/standalone/tests/combined_test.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ constexpr size_t kMaxAlign = std::max({
8888
#if SCUDO_CAN_USE_PRIMARY64
8989
alignof(scudo::Allocator<scudo::FuchsiaConfig>),
9090
#endif
91-
alignof(scudo::Allocator<scudo::AndroidSvelteConfig>),
9291
alignof(scudo::Allocator<scudo::AndroidConfig>)
9392
});
9493

@@ -102,7 +101,6 @@ struct TestAllocatorStorage {
102101
#if SCUDO_CAN_USE_PRIMARY64
103102
sizeof(scudo::Allocator<scudo::FuchsiaConfig>),
104103
#endif
105-
sizeof(scudo::Allocator<scudo::AndroidSvelteConfig>),
106104
sizeof(scudo::Allocator<scudo::AndroidConfig>)
107105
});
108106

@@ -168,11 +166,9 @@ template <typename T> using ScudoCombinedDeathTest = ScudoCombinedTest<T>;
168166

169167
#if SCUDO_FUCHSIA
170168
#define SCUDO_TYPED_TEST_ALL_TYPES(FIXTURE, NAME) \
171-
SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, AndroidSvelteConfig) \
172169
SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, FuchsiaConfig)
173170
#else
174171
#define SCUDO_TYPED_TEST_ALL_TYPES(FIXTURE, NAME) \
175-
SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, AndroidSvelteConfig) \
176172
SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, DefaultConfig) \
177173
SCUDO_TYPED_TEST_TYPE(FIXTURE, NAME, AndroidConfig)
178174
#endif

compiler-rt/lib/scudo/standalone/tests/primary_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "tests/scudo_unit_test.h"
1010

11+
#include "allocator_config.h"
1112
#include "primary32.h"
1213
#include "primary64.h"
1314
#include "size_class_map.h"
@@ -283,7 +284,7 @@ SCUDO_TYPED_TEST(ScudoPrimaryTest, PrimaryIterate) {
283284
}
284285

285286
SCUDO_TYPED_TEST(ScudoPrimaryTest, PrimaryThreaded) {
286-
using Primary = TestAllocator<TypeParam, scudo::SvelteSizeClassMap>;
287+
using Primary = TestAllocator<TypeParam, scudo::Config::Primary::SizeClassMap>;
287288
std::unique_ptr<Primary> Allocator(new Primary);
288289
Allocator->init(/*ReleaseToOsInterval=*/-1);
289290
std::mutex Mutex;

compiler-rt/lib/scudo/standalone/tests/release_test.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,22 +552,16 @@ TEST(ScudoReleaseTest, ReleaseFreeMemoryToOSAndroid) {
552552
testReleaseFreeMemoryToOS<scudo::AndroidSizeClassMap>();
553553
}
554554

555-
TEST(ScudoReleaseTest, ReleaseFreeMemoryToOSSvelte) {
556-
testReleaseFreeMemoryToOS<scudo::SvelteSizeClassMap>();
557-
}
558-
559555
TEST(ScudoReleaseTest, PageMapMarkRange) {
560556
testPageMapMarkRange<scudo::DefaultSizeClassMap>();
561557
testPageMapMarkRange<scudo::AndroidSizeClassMap>();
562558
testPageMapMarkRange<scudo::FuchsiaSizeClassMap>();
563-
testPageMapMarkRange<scudo::SvelteSizeClassMap>();
564559
}
565560

566561
TEST(ScudoReleaseTest, ReleasePartialRegion) {
567562
testReleasePartialRegion<scudo::DefaultSizeClassMap>();
568563
testReleasePartialRegion<scudo::AndroidSizeClassMap>();
569564
testReleasePartialRegion<scudo::FuchsiaSizeClassMap>();
570-
testReleasePartialRegion<scudo::SvelteSizeClassMap>();
571565
}
572566

573567
template <class SizeClassMap> void testReleaseRangeWithSingleBlock() {
@@ -630,7 +624,6 @@ TEST(ScudoReleaseTest, RangeReleaseRegionWithSingleBlock) {
630624
testReleaseRangeWithSingleBlock<scudo::DefaultSizeClassMap>();
631625
testReleaseRangeWithSingleBlock<scudo::AndroidSizeClassMap>();
632626
testReleaseRangeWithSingleBlock<scudo::FuchsiaSizeClassMap>();
633-
testReleaseRangeWithSingleBlock<scudo::SvelteSizeClassMap>();
634627
}
635628

636629
TEST(ScudoReleaseTest, BufferPool) {

compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ TEST(ScudoSizeClassMapTest, DefaultSizeClassMap) {
2020
testSizeClassMap<scudo::DefaultSizeClassMap>();
2121
}
2222

23-
TEST(ScudoSizeClassMapTest, SvelteSizeClassMap) {
24-
testSizeClassMap<scudo::SvelteSizeClassMap>();
25-
}
26-
2723
TEST(ScudoSizeClassMapTest, AndroidSizeClassMap) {
2824
testSizeClassMap<scudo::AndroidSizeClassMap>();
2925
}

0 commit comments

Comments
 (0)