mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-24 17:01:07 +00:00
Revert "[scudo] Use template specialization on Quarantine to avoid zero-length array"
This reverts commit 7dda44c189
.
This commit is contained in:
parent
d9ef6ad05f
commit
a52868a55c
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user