mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-10 01:28:41 +01:00
python accessing freed shared memory object (#1253)
* added a 'isValid' member in shared memory (also updated shm version) with default true, any access to shared memory() checks also for validity. any free will set this to false and then unmap shm. Any access to shm will then check validity in python. * fixed tests for shm * added tests in python as well --------- Co-authored-by: Alice <alice.mazzoleni@psi.ch>
This commit is contained in:
@@ -112,4 +112,12 @@ struct Conjunction<B1, Bn...>
|
||||
template <typename T, typename... Ts>
|
||||
using AllSame =
|
||||
typename std::enable_if<Conjunction<std::is_same<T, Ts>...>::value>::type;
|
||||
|
||||
// Trait to detect if T has a bool member named 'isValid'
|
||||
template <typename, typename = std::void_t<>>
|
||||
struct has_bool_isValid : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct has_bool_isValid<T, std::void_t<decltype(std::declval<T>().isValid)>>
|
||||
: std::is_same<decltype(std::declval<T>().isValid), bool> {};
|
||||
} // namespace sls
|
||||
Reference in New Issue
Block a user