This is an archive of the discontinued LLVM Phabricator instance.

build: Remove the cmake check for malloc.h.
ClosedPublic

Authored by pcc on Feb 6 2019, 12:15 AM.

Details

Summary

As far as I can tell, malloc.h is only being used here to provide
a definition of mallinfo (malloc itself is declared in stdlib.h via
cstdlib). We already have a macro for whether mallinfo is available,
so switch to using that instead.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Feb 6 2019, 12:15 AM
thakis accepted this revision.Feb 6 2019, 5:59 AM

Nice!

llvm/lib/Support/Unix/Process.inc
36 ↗(On Diff #185494)

This change kind of assumes that HAVE_MALLINFO is false on dragonfly and openbsd. But I suppose it's consistent with check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO) in config-ix.cmake.

This revision is now accepted and ready to land.Feb 6 2019, 5:59 AM
pcc marked an inline comment as done.Feb 6 2019, 11:19 AM
pcc added inline comments.
llvm/lib/Support/Unix/Process.inc
36 ↗(On Diff #185494)

Yes and neither of those platforms have a mallinfo, or ever had it as far as I can tell, so this change should be fine on those platforms.

This revision was automatically updated to reflect the committed changes.