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
[ROCm/clr commit: ee24635439]
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
مرجع در شماره جدید
Block a user