This is an archive of the discontinued LLVM Phabricator instance.

Clean up use of C allocation functions
ClosedPublic

Authored by sepavloff on Feb 7 2018, 5:14 AM.

Details

Summary

This change cleans up uses of malloc/calloc/realloc. In the case where
the return value is not checked agains null pointer, the call to
'std::malloc' is replaced by 'llvm::malloc', which reports fatal error
on allocation failure. In plain C files, assertion statements are added
to ensure that memory is successfully allocated.

The aim of this change is to get better diagnostics of OOM on Windows.

Diff Detail

Repository
rL LLVM

Event Timeline

sepavloff created this revision.Feb 7 2018, 5:14 AM
rnk accepted this revision.Feb 7 2018, 10:43 AM

lgtm

This revision is now accepted and ready to land.Feb 7 2018, 10:43 AM
This revision was automatically updated to reflect the committed changes.