diff options
author | Dominic Chen <ddchen@apple.com> | 2022-04-19 01:38:43 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-04-19 01:38:43 +0000 |
commit | 56ca92b4e24ccc8dd0133dbded6188552e66fddf (patch) | |
tree | 8ebe900596cafe4f386d09aec51c835f985a1c06 | |
parent | e39fa6cc283ddc1993958b20bafc70a325728a94 (diff) | |
parent | fb37ef04c942b578084c135ab033161ff44cc99b (diff) | |
download | scudo-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.h | 14 |
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 { |