mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
fix: disallow copy and move
Related-To: NEO-15630 Signed-off-by: Jakub Nowacki <jakub.nowacki@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3ab74c7fba
commit
259271f59d
@@ -9,6 +9,7 @@
|
||||
#include "shared/source/compiler_interface/os_compiler_cache_helper.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/helpers/path.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
@@ -202,7 +203,7 @@ void CompilerCache::lockConfigFileAndReadSize(const std::string &configFilePath,
|
||||
}
|
||||
}
|
||||
|
||||
class HandleGuard {
|
||||
class HandleGuard : NonCopyableAndNonMovableClass {
|
||||
public:
|
||||
HandleGuard() = delete;
|
||||
explicit HandleGuard(int &fileDescriptor) : fd(fileDescriptor) {}
|
||||
@@ -216,6 +217,8 @@ class HandleGuard {
|
||||
int fd = -1;
|
||||
};
|
||||
|
||||
static_assert(NonCopyableAndNonMovable<HandleGuard>);
|
||||
|
||||
bool CompilerCache::cacheBinary(const std::string &kernelFileHash, const char *pBinary, size_t binarySize) {
|
||||
if (pBinary == nullptr || binarySize == 0 || binarySize > config.cacheSize) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user