aboutsummaryrefslogtreecommitdiffstats
path: root/core/device.cpp
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-05 13:52:12 +0100
committerSven Göthel <[email protected]>2024-01-05 13:52:12 +0100
commitec98cdacc85ff0202852472c7756586437912f22 (patch)
tree42414746a27ab35cb8cdbc95af521d74821e57f4 /core/device.cpp
parentfd5269bec9a5fe4815974b1786a037e6a247bfd2 (diff)
parentb82cd2e60edb8fbe5fdd3567105ae76a016a554c (diff)
Merge remote-tracking branch 'upstream/master'HEADmaster
Diffstat (limited to 'core/device.cpp')
-rw-r--r--core/device.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/device.cpp b/core/device.cpp
index 2766c5e4..795a9601 100644
--- a/core/device.cpp
+++ b/core/device.cpp
@@ -9,15 +9,12 @@
#include "mastering.h"
-al::FlexArray<ContextBase*> DeviceBase::sEmptyContextArray{0u};
+static_assert(std::atomic<std::chrono::nanoseconds>::is_always_lock_free);
-DeviceBase::DeviceBase(DeviceType type) : Type{type}, mContexts{&sEmptyContextArray}
+DeviceBase::DeviceBase(DeviceType type)
+ : Type{type}, mContexts{al::FlexArray<ContextBase*>::Create(0)}
{
}
-DeviceBase::~DeviceBase()
-{
- auto *oldarray = mContexts.exchange(nullptr, std::memory_order_relaxed);
- if(oldarray != &sEmptyContextArray) delete oldarray;
-}
+DeviceBase::~DeviceBase() = default;