mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +08:00
fix: explicitly remove assign operators when not needed
when class defines copy/move ctor then corresponding assign operator(s) should be defined or deleted Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3fdcf049bf
commit
a420e34b10
@@ -26,11 +26,4 @@ class NonCopyableClass {
|
||||
NonCopyableClass(NonCopyableClass &&) = default;
|
||||
NonCopyableClass &operator=(NonCopyableClass &&) = default;
|
||||
};
|
||||
|
||||
class NonAssignableClass {
|
||||
public:
|
||||
NonAssignableClass() = default;
|
||||
NonAssignableClass &operator=(const NonAssignableClass &) = delete;
|
||||
NonAssignableClass &operator=(NonAssignableClass &&) = delete;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/memory_manager/allocation_type.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
@@ -18,11 +17,13 @@ namespace NEO {
|
||||
class MigrationSyncData;
|
||||
class GraphicsAllocation;
|
||||
|
||||
class MultiGraphicsAllocation : NonAssignableClass {
|
||||
class MultiGraphicsAllocation {
|
||||
public:
|
||||
MultiGraphicsAllocation(uint32_t maxRootDeviceIndex);
|
||||
MultiGraphicsAllocation(const MultiGraphicsAllocation &multiGraphicsAllocation);
|
||||
MultiGraphicsAllocation(MultiGraphicsAllocation &&);
|
||||
MultiGraphicsAllocation &operator=(const MultiGraphicsAllocation &) = delete;
|
||||
MultiGraphicsAllocation &operator=(MultiGraphicsAllocation &&) = delete;
|
||||
~MultiGraphicsAllocation();
|
||||
|
||||
GraphicsAllocation *getDefaultGraphicsAllocation() const;
|
||||
|
||||
@@ -32,7 +32,7 @@ struct SmallBuffersParams {
|
||||
};
|
||||
|
||||
template <typename PoolT, typename BufferType, typename BufferParentType = BufferType>
|
||||
struct AbstractBuffersPool : public SmallBuffersParams<PoolT>, public NonCopyableClass, NonAssignableClass {
|
||||
struct AbstractBuffersPool : public SmallBuffersParams<PoolT>, public NonCopyableClass {
|
||||
// The prototype of a function allocating the `mainStorage` is not specified.
|
||||
// That would be an unnecessary limitation here - it is completely up to derived class implementation.
|
||||
// Perhaps the allocating function needs to leverage `HeapAllocator::allocate()` and also
|
||||
@@ -48,6 +48,7 @@ struct AbstractBuffersPool : public SmallBuffersParams<PoolT>, public NonCopyabl
|
||||
|
||||
AbstractBuffersPool(MemoryManager *memoryManager, OnChunkFreeCallback onChunkFreeCallback);
|
||||
AbstractBuffersPool(AbstractBuffersPool<PoolT, BufferType, BufferParentType> &&bufferPool);
|
||||
AbstractBuffersPool &operator=(AbstractBuffersPool &&) = delete;
|
||||
void tryFreeFromPoolBuffer(BufferParentType *possiblePoolBuffer, size_t offset, size_t size);
|
||||
bool isPoolBuffer(const BufferParentType *buffer) const;
|
||||
void drain();
|
||||
|
||||
@@ -6,15 +6,12 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <typename DataType>
|
||||
struct Range : NonAssignableClass {
|
||||
struct Range {
|
||||
using iterator = DataType *;
|
||||
using const_iterator = const DataType *;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
@@ -37,6 +34,7 @@ struct Range : NonAssignableClass {
|
||||
Range(T (&base)[S])
|
||||
: Range(&base[0], S) {
|
||||
}
|
||||
Range &operator=(const Range &) = delete;
|
||||
|
||||
iterator begin() {
|
||||
return begIt;
|
||||
|
||||
Reference in New Issue
Block a user