fix: allowing neo ULT build with optimization enabled 5/n

- fix mismatched-new-delete warnings
- fix initialization warnings
- fix attempt to free a non-heap object warnings

Related-To: NEO-8116

Signed-off-by: Oskar Hubert Weber <oskar.hubert.weber@intel.com>
This commit is contained in:
Oskar Hubert Weber
2024-12-18 14:51:08 +00:00
committed by Compute-Runtime-Automation
parent dec695f405
commit 1c1b2db9a9
8 changed files with 39 additions and 21 deletions

View File

@@ -67,7 +67,9 @@ bool checkDefaultCacheDirSettings(std::string &cacheDir, NEO::EnvironmentVariabl
}
time_t getFileModificationTime(const std::string &path) {
struct stat st;
struct stat st {
0, 0
};
if (NEO::SysCalls::stat(path, &st) == 0) {
return st.st_mtime;
}
@@ -75,7 +77,9 @@ time_t getFileModificationTime(const std::string &path) {
}
size_t getFileSize(const std::string &path) {
struct stat st;
struct stat st {
0, 0
};
if (NEO::SysCalls::stat(path, &st) == 0) {
return static_cast<size_t>(st.st_size);
}