Page MenuHomePhabricator

[Support] Make GetMallocUsage() aware of jemalloc
ClosedPublic

Authored by davide on Feb 15 2015, 11:40 PM.

Details

Summary

When getting info about heap usage (e.g. ld --stats) I think it is desiderable to have something more fine-grained than sbrk() on systems where the default allocator is jemalloc (namely, FreeBSD). I wasn't sure who to put as reviewer to this change, feel free to comment. Also, I noticed that GetMallocUsage() isn't unit-tested (or at least I didn't find where it is unit-tested), so, maybe , enhancing the testing coverage might be considered in this (or a subsequent) commit.

Diff Detail

Event Timeline

davide updated this revision to Diff 20003.Feb 15 2015, 11:40 PM
davide retitled this revision from to [Support] Make GetMallocUsage() aware of jemalloc.
davide updated this object.
davide edited the test plan for this revision. (Show Details)
davide set the repository for this revision to rL LLVM.
davide added subscribers: Unknown Object (MLST), emaste.
shankarke accepted this revision.Feb 17 2015, 8:19 PM
shankarke edited edge metadata.
This revision is now accepted and ready to land.Feb 17 2015, 8:19 PM
majnemer added inline comments.
lib/Support/Unix/Process.inc
109–110

No need for an else.

I do agree with you and I'm generally a big fan of avoiding 'else' unless necessary but a couple of lines below that if/else is used so I'd keep that for consistency and (eventually) change in a subsequent commit, in order to not mix style/functional modifications.
Does this make sense to you?

I do agree with you and I'm generally a big fan of avoiding 'else' unless necessary but a couple of lines below that if/else is used so I'd keep that for consistency and (eventually) change in a subsequent commit, in order to not mix style/functional modifications.
Does this make sense to you?

Makes sense.

davide closed this revision.Feb 18 2015, 11:29 PM