Fail gracefully if memory allocation did not succeed

Testing: precheckin (http://ocltc.amd.com:8111/viewModification.html?modId=69427&personal=true&tab=vcsModificationBuilds)

[git-p4: depot-paths = "//depot/stg/hsa/drivers/hsa/runtime/": change = 1256179]


[ROCm/ROCR-Runtime commit: 503fd728dd]
Этот коммит содержится в:
Zhuravlyov, Konstantin (x21446) MA
2016-04-09 16:40:24 -05:00
родитель 1063b89f2d
Коммит de9132a710
+4 -1
Просмотреть файл
@@ -472,7 +472,10 @@ void* LoaderContext::SegmentAlloc(amdgpu_hsa_elf_segment_t segment,
if (nullptr == mem) {
return nullptr;
}
mem->Allocate(size, align, zero);
if (!mem->Allocate(size, align, zero)) {
delete mem;
return nullptr;
}
return mem;
}