On Mon, 28 Mar 2022 22:25:01 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> src/hotspot/share/utilities/elfFile.cpp line 450: >> >>> 448: if (buf == nullptr) { >>> 449: return false; >>> 450: } >> >> I'd move this close to and local to where it is used. >> >> Also, you seem to repeat the same pattern a lot "NEW_RESOURCE_ARRAY(n), if >> error return something". I'd factor this out to an utility function or >> utility macro, maybe one where you pass the error return value as macro >> parameter. > > Thomas's comment caught my attention in the email. NEW_RESOURCE_ARRAY aborts > the VM on OOM. Use NEW_RESOURCE_ARRAY_RETURN_NULL if you want to continue. As I wrote in another comment, I'd rather we avoid RA altogether since it relies on Thread::current(), and we want to see callstacks even with Thread::current==NULL. ------------- PR: https://git.openjdk.java.net/jdk/pull/7126