Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D115210
return res;
}
+void StackStore::LockAll() {
+ for (BlockInfo &b : blocks_) b.Lock();
+}
+
+void StackStore::UnlockAll() {
+ for (BlockInfo &b : blocks_) b.Unlock();
+}
+
void StackStore::TestOnlyUnmap() {
for (BlockInfo &b : blocks_) b.TestOnlyUnmap(this);
internal_memset(this, 0, sizeof(*this));
// Returns the number of released bytes.
uptr Pack(Compression type);
+ void LockAll();
+ void UnlockAll();
+
void TestOnlyUnmap();
private:
void TestOnlyUnmap(StackStore *store);
bool Stored(uptr n);
bool IsPacked() const;
+ void Lock() NO_THREAD_SAFETY_ANALYSIS { mtx_.Lock(); }
+ void Unlock() NO_THREAD_SAFETY_ANALYSIS { mtx_.Unlock(); }
};
BlockInfo blocks_[kBlockCount] = {};
void StackDepotLockAll() {
theDepot.LockAll();
+ stackStore.LockAll();
}
void StackDepotUnlockAll() {
+ stackStore.UnlockAll();
theDepot.UnlockAll();
}