fix: Add asserts to ensure NonCopyable and NonMovable n/n

Related-To: NEO-14068

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2025-02-18 17:32:35 +00:00
committed by Compute-Runtime-Automation
parent aeff5513c3
commit b60c02d597
36 changed files with 71 additions and 51 deletions

View File

@@ -61,7 +61,7 @@ struct AbstractBuffersPool : public NonCopyableClass {
AbstractBuffersPool(MemoryManager *memoryManager, OnChunkFreeCallback onChunkFreeCallback);
AbstractBuffersPool(MemoryManager *memoryManager, OnChunkFreeCallback onChunkFreeCallback, const SmallBuffersParams &params);
AbstractBuffersPool(AbstractBuffersPool<PoolT, BufferType, BufferParentType> &&bufferPool);
AbstractBuffersPool &operator=(AbstractBuffersPool &&) = delete;
AbstractBuffersPool &operator=(AbstractBuffersPool &&other) noexcept = delete;
virtual ~AbstractBuffersPool() = default;
void tryFreeFromPoolBuffer(BufferParentType *possiblePoolBuffer, size_t offset, size_t size);

View File

@@ -8,6 +8,7 @@
#pragma once
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include <atomic>
#include <thread>
@@ -168,7 +169,7 @@ struct IDNode {
};
template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = false, bool supportRecursiveLock = true>
class IDList {
class IDList : NEO::NonCopyableAndNonMovableClass {
public:
using ThisType = IDList<NodeObjectType, threadSafe, ownsNodes, supportRecursiveLock>;
@@ -192,9 +193,6 @@ class IDList {
this->cleanup();
}
IDList(const IDList &) = delete;
IDList &operator=(const IDList &) = delete;
void pushFrontOne(NodeObjectType &node) {
processLocked<ThisType, &ThisType::pushFrontOneImpl>(&node);
}

View File

@@ -8,6 +8,7 @@
#pragma once
#include "shared/source/helpers/mt_helpers.h"
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include <atomic>
#include <memory>
@@ -89,7 +90,7 @@ struct IFNode {
};
template <typename NodeObjectType, bool threadSafe = true, bool ownsNodes = false>
class IFList {
class IFList : NEO::NonCopyableAndNonMovableClass {
public:
IFList()
: head(nullptr) {
@@ -103,9 +104,6 @@ class IFList {
this->cleanup();
}
IFList(const IFList &) = delete;
IFList &operator=(const IFList &) = delete;
template <bool c = threadSafe>
typename std::enable_if<c, void>::type pushFrontOne(NodeObjectType &node) {
node.next = head;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -7,6 +7,7 @@
#pragma once
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include <atomic>
#include <memory>
@@ -169,7 +170,7 @@ inline ReferenceTrackedObject<DerivedClass>::~ReferenceTrackedObject() {
}
template <typename RefTrackedObj>
class DecRefInternalAtScopeEnd final {
class DecRefInternalAtScopeEnd final : NEO::NonCopyableAndNonMovableClass {
public:
DecRefInternalAtScopeEnd(RefTrackedObj &obj) : object{obj} {
}
@@ -178,11 +179,6 @@ class DecRefInternalAtScopeEnd final {
object.decRefInternal();
}
DecRefInternalAtScopeEnd(const DecRefInternalAtScopeEnd &) = delete;
DecRefInternalAtScopeEnd(DecRefInternalAtScopeEnd &&) = delete;
DecRefInternalAtScopeEnd &operator=(const DecRefInternalAtScopeEnd &) = delete;
DecRefInternalAtScopeEnd &operator=(DecRefInternalAtScopeEnd &&) = delete;
private:
RefTrackedObj &object;
};