Fix MSVC 15.3 CE.
GitOrigin-RevId: d049c35a3717374d6830555330b10ff6bac3bf1c
This commit is contained in:
parent
f8f7e32ba5
commit
ca550f5202
@ -95,13 +95,13 @@ class EpochBasedMemoryReclamation {
|
|||||||
static constexpr size_t MAX_BAGS = 3;
|
static constexpr size_t MAX_BAGS = 3;
|
||||||
struct ThreadData {
|
struct ThreadData {
|
||||||
std::atomic<int64> epoch{1};
|
std::atomic<int64> epoch{1};
|
||||||
char pad[TD_CONCURRENCY_PAD - sizeof(epoch)];
|
char pad[TD_CONCURRENCY_PAD - sizeof(std::atomic<int64>)];
|
||||||
|
|
||||||
size_t to_skip{0};
|
size_t to_skip{0};
|
||||||
size_t checked_thread_i{0};
|
size_t checked_thread_i{0};
|
||||||
size_t bag_i{0};
|
size_t bag_i{0};
|
||||||
std::vector<unique_ptr<T>> to_delete[MAX_BAGS];
|
std::vector<unique_ptr<T>> to_delete[MAX_BAGS];
|
||||||
char pad2[TD_CONCURRENCY_PAD - sizeof(to_delete)];
|
char pad2[TD_CONCURRENCY_PAD - sizeof(std::vector<unique_ptr<T>>) * MAX_BAGS];
|
||||||
|
|
||||||
void rotate_bags() {
|
void rotate_bags() {
|
||||||
bag_i = (bag_i + 1) % MAX_BAGS;
|
bag_i = (bag_i + 1) % MAX_BAGS;
|
||||||
@ -131,10 +131,10 @@ class EpochBasedMemoryReclamation {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
std::vector<ThreadData> threads_;
|
std::vector<ThreadData> threads_;
|
||||||
char pad[TD_CONCURRENCY_PAD - sizeof(threads_)];
|
char pad[TD_CONCURRENCY_PAD - sizeof(std::vector<ThreadData>)];
|
||||||
|
|
||||||
std::atomic<int64> epoch_{1};
|
std::atomic<int64> epoch_{1};
|
||||||
char pad2[TD_CONCURRENCY_PAD - sizeof(epoch_)];
|
char pad2[TD_CONCURRENCY_PAD - sizeof(std::atomic<int64>)];
|
||||||
|
|
||||||
void lock(size_t thread_id) {
|
void lock(size_t thread_id) {
|
||||||
auto &data = threads_[thread_id];
|
auto &data = threads_[thread_id];
|
||||||
|
@ -97,14 +97,14 @@ class HazardPointers {
|
|||||||
private:
|
private:
|
||||||
struct ThreadData {
|
struct ThreadData {
|
||||||
std::array<std::atomic<T *>, MaxPointersN> hazard_;
|
std::array<std::atomic<T *>, MaxPointersN> hazard_;
|
||||||
char pad[TD_CONCURRENCY_PAD - sizeof(hazard_)];
|
char pad[TD_CONCURRENCY_PAD - sizeof(std::array<std::atomic<T *>, MaxPointersN>)];
|
||||||
|
|
||||||
// stupid gc
|
// stupid gc
|
||||||
std::vector<std::unique_ptr<T, Deleter>> to_delete_;
|
std::vector<std::unique_ptr<T, Deleter>> to_delete_;
|
||||||
char pad2[TD_CONCURRENCY_PAD - sizeof(to_delete_)];
|
char pad2[TD_CONCURRENCY_PAD - sizeof(std::vector<std::unique_ptr<T, Deleter>>)];
|
||||||
};
|
};
|
||||||
std::vector<ThreadData> threads_;
|
std::vector<ThreadData> threads_;
|
||||||
char pad2[TD_CONCURRENCY_PAD - sizeof(threads_)];
|
char pad2[TD_CONCURRENCY_PAD - sizeof(std::vector<ThreadData>)];
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
static S *do_protect(std::atomic<T *> &hazard_ptr, std::atomic<S *> &to_protect) {
|
static S *do_protect(std::atomic<T *> &hazard_ptr, std::atomic<S *> &to_protect) {
|
||||||
|
Reference in New Issue
Block a user