summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic Chen <ddchen@apple.com>2022-04-19 01:38:43 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-19 01:38:43 +0000
commit56ca92b4e24ccc8dd0133dbded6188552e66fddf (patch)
tree8ebe900596cafe4f386d09aec51c835f985a1c06
parente39fa6cc283ddc1993958b20bafc70a325728a94 (diff)
parentfb37ef04c942b578084c135ab033161ff44cc99b (diff)
downloadscudo-56ca92b4e24ccc8dd0133dbded6188552e66fddf.tar.gz
Revert "[scudo] Use template specialization on Quarantine to avoid zero-length array" am: 77c8e58509 am: 0b94ec9aed am: c4aefe674b am: fb37ef04c9
Original change: https://android-review.googlesource.com/c/platform/external/scudo/+/2066947 Change-Id: Ibfd2a707d4370fce01f3a063949d165a567e8e7a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--standalone/secondary.h14
1 files changed, 1 insertions, 13 deletions
diff --git a/standalone/secondary.h b/standalone/secondary.h
index 0f8fafe0a6b..abb58a2882a 100644
--- a/standalone/secondary.h
+++ b/standalone/secondary.h
@@ -362,18 +362,6 @@ private:
u64 Time;
};
- // Template specialization to avoid producing zero-length array
- template <size_t Size> class QuarantineBlocks {
- public:
- CachedBlock &operator[](uptr Idx) { return Blocks[Idx]; }
- private:
- CachedBlock Blocks[Size];
- };
- template <> class QuarantineBlocks<0> {
- public:
- CachedBlock &operator[](uptr UNUSED Idx) { UNREACHABLE("Unsupported!"); }
- };
-
void releaseIfOlderThan(CachedBlock &Entry, u64 Time) {
if (!Entry.CommitBase || !Entry.Time)
return;
@@ -407,7 +395,7 @@ private:
atomic_s32 ReleaseToOsIntervalMs = {};
CachedBlock Entries[Config::SecondaryCacheEntriesArraySize] = {};
- QuarantineBlocks<Config::SecondaryCacheQuarantineSize> Quarantine = {};
+ CachedBlock Quarantine[Config::SecondaryCacheQuarantineSize] = {};
};
template <typename Config> class MapAllocator {