P4 to Git Change 1445015 by jatang@jatang-opencl-hsa-stg1 on 2017/08/09 09:53:58

SWDEV-121625 - Fix a memory leak.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#34 edit
Dieser Commit ist enthalten in:
foreman
2017-08-09 10:07:10 -04:00
Ursprung f0156efc5b
Commit ee24635439
2 geänderte Dateien mit 16 neuen und 8 gelöschten Zeilen
+8 -4
Datei anzeigen
@@ -172,10 +172,14 @@ static void checkLLVM_BIN() {
if (llvmBin_.empty()) {
Dl_info info;
if (dladdr((const void*)&amd::Device::init, &info)) {
llvmBin_ = dirname(strdup(info.dli_fname));
size_t pos = llvmBin_.rfind("lib");
if (pos != std::string::npos) {
llvmBin_.replace(pos, 3, "bin");
char* str = strdup(info.dli_fname);
if (str) {
llvmBin_ = dirname(str);
free(str);
size_t pos = llvmBin_.rfind("lib");
if (pos != std::string::npos) {
llvmBin_.replace(pos, 3, "bin");
}
}
}
}
+8 -4
Datei anzeigen
@@ -367,10 +367,14 @@ static void checkLLVM_BIN() {
if (llvmBin_.empty()) {
Dl_info info;
if (dladdr((const void*)&amd::Device::init, &info)) {
llvmBin_ = dirname(strdup(info.dli_fname));
size_t pos = llvmBin_.rfind("lib");
if (pos != std::string::npos) {
llvmBin_.replace(pos, 3, "bin");
char* str = strdup(info.dli_fname);
if (str) {
llvmBin_ = dirname(str);
free(str);
size_t pos = llvmBin_.rfind("lib");
if (pos != std::string::npos) {
llvmBin_.replace(pos, 3, "bin");
}
}
}
}